chg: updated tests/test_web.py in order to retrieve the API_TOKEN provided via environment variable (secrets.API_KEY on GitHub workflow).

This commit is contained in:
Cédric Bonhomme 2024-07-25 14:42:37 +02:00
parent 016529d2fb
commit c01d1c5460
Signed by untrusted user who does not match committer: cedric
GPG key ID: A1CB94DE57B7A70D

View file

@ -2,6 +2,7 @@
import unittest
import time
import os
from pyvulnerabilitylookup import PyVulnerabilityLookup
@ -9,7 +10,8 @@ from pyvulnerabilitylookup import PyVulnerabilityLookup
class TestPublic(unittest.TestCase):
def setUp(self) -> None:
self.client = PyVulnerabilityLookup(root_url="https://vulnerability.circl.lu")
token = os.getenv("API_KEY", "")
self.client = PyVulnerabilityLookup(root_url="https://vulnerability.circl.lu", token=token)
# Test default