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

Method test_wait_until

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

Source from the content-addressed store, hash-verified

249 self._assert_isotime(calls[0][1][2], until)
250
251 def test_wait_until(self):
252 extr = extractor.find("generic:https://example.org/")
253 until = time.time() + 5
254
255 with patch("time.sleep") as sleep, patch.object(extr, "log") as log:
256 extr.wait(until=until)
257
258 calls = sleep.mock_calls
259 self.assertEqual(len(calls), 1)
260 self.assertAlmostEqual(calls[0][1][0], 6.0, places=0)
261
262 calls = log.info.mock_calls
263 self.assertEqual(len(calls), 1)
264 self.assertEqual(calls[0][1][1], "5 seconds")
265 self._assert_isotime(calls[0][1][2], until)
266
267 def test_wait_until_datetime(self):
268 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