(self)
| 219 | class 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/") |
nothing calls this directly
no test coverage detected