From 0281341a3b257809e0edff1a4fd5b066edc60f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 19 Jan 2024 00:51:57 +0100 Subject: [PATCH] fix: wait for pysec to be done. --- tests/test_web.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_web.py b/tests/test_web.py index e95c39b..8d9dea9 100644 --- a/tests/test_web.py +++ b/tests/test_web.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import unittest +import time from pyvulnerabilitylookup import PyVulnerabilityLookup @@ -15,5 +16,9 @@ class TestBasic(unittest.TestCase): self.assertTrue(self.client.redis_up()) def test_get_vulnerability(self) -> None: - vuln = self.client.get_vulnerability('PYSEC-2024-4') - self.assertEqual(vuln['id'], 'PYSEC-2024-4') + while True: + if vuln := self.client.get_vulnerability('PYSEC-2024-4'): + self.assertEqual(vuln['id'], 'PYSEC-2024-4') + break + print('waiting for pysec to be imported') + time.sleep(1)