Wait only 5 seconds for CWA on the story page
A job still waits for the full timeout.
This commit is contained in:
@@ -75,6 +75,17 @@ def test_get_book(fake):
|
||||
assert c.get_book("nope") is None
|
||||
|
||||
|
||||
def test_get_book_can_wait_for_a_shorter_time(fake, monkeypatch):
|
||||
c = client(fake)
|
||||
get = c.session.get
|
||||
timeouts = []
|
||||
monkeypatch.setattr(c.session, "get", lambda url, **kw: timeouts.append(kw["timeout"]) or get(url, **kw))
|
||||
c.get_book("uuid-2", timeout=5)
|
||||
c.get_book("uuid-2")
|
||||
c.search("Story")
|
||||
assert timeouts == [5, 60, 60]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("book_uuid", ["../opds", "uuid-2?x=1", "uuid-2#x", "uuid%2F2", ""])
|
||||
def test_get_book_refuses_a_uuid_that_changes_the_path(book_uuid):
|
||||
# Nothing listens on this port, so a request would raise CwaError.
|
||||
|
||||
Reference in New Issue
Block a user