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

Method test_wait_seconds_long

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

Source from the content-addressed store, hash-verified

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/")
238 seconds = 5000
239 until = time.time() + seconds
240
241 with patch("time.sleep") as sleep, patch.object(extr, "log") as log:
242 extr.wait(seconds=seconds)
243
244 sleep.assert_called_once_with(5001.0)
245
246 calls = log.info.mock_calls
247 self.assertEqual(len(calls), 1)
248 self.assertEqual(calls[0][1][1], "1h 23min")
249 self._assert_isotime(calls[0][1][2], until)
250
251 def test_wait_until(self):
252 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