MCPcopy
hub / github.com/mikf/gallery-dl / test_wait_seconds

Method test_wait_seconds

test/test_extractor.py:221–234  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

219class TestExtractorWait(unittest.TestCase):
220
221 def test_wait_seconds(self):
222 extr = extractor.find("generic:https://example.org/")
223 seconds = 5
224 until = time.time() + seconds
225
226 with patch("time.sleep") as sleep, patch.object(extr, "log") as log:
227 extr.wait(seconds=seconds)
228
229 sleep.assert_called_once_with(6.0)
230
231 calls = log.info.mock_calls
232 self.assertEqual(len(calls), 1)
233 self.assertEqual(calls[0][1][1], "6 seconds")
234 self._assert_isotime(calls[0][1][2], until)
235
236 def test_wait_seconds_long(self):
237 extr = extractor.find("generic:https://example.org/")

Callers

nothing calls this directly

Calls 3

_assert_isotimeMethod · 0.95
waitMethod · 0.80
assertEqualMethod · 0.80

Tested by

no test coverage detected