From 6db7ecf62a09eef1241ead4c4e3684c48fc634d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 26 Nov 2024 12:17:51 +0100 Subject: [PATCH] fix: incorrect call for searching vendor and product --- pyvulnerabilitylookup/api.py | 7 +++---- tests/test_web.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyvulnerabilitylookup/api.py b/pyvulnerabilitylookup/api.py index ef23a76..120b16d 100644 --- a/pyvulnerabilitylookup/api.py +++ b/pyvulnerabilitylookup/api.py @@ -3,7 +3,6 @@ from __future__ import annotations import logging -import functools from datetime import date, datetime from importlib.metadata import version @@ -68,14 +67,14 @@ class PyVulnerabilityLookup(): def redis_up(self) -> bool: '''Check if redis is up and running''' - r = self.session.get(urljoin(self.root_url, str(PurePosixPath('api', 'system','redis_up')))) + r = self.session.get(urljoin(self.root_url, str(PurePosixPath('api', 'system', 'redis_up')))) return r.json() # #### DB status #### def get_info(self) -> dict[str, Any]: '''Get more information about the current databases in use and when it was updated''' - r = self.session.get(urljoin(self.root_url, str(PurePosixPath('api', 'system','dbInfo')))) + r = self.session.get(urljoin(self.root_url, str(PurePosixPath('api', 'system', 'dbInfo')))) return r.json() def get_config_info(self) -> dict[str, Any]: @@ -143,7 +142,7 @@ class PyVulnerabilityLookup(): :param vendor: A vendor owning products (must be in the known vendor list) :param product: A product owned by that vendor ''' - r = self.session.get(urljoin(self.root_url, str(PurePosixPath('api', 'vulnerability', 'browse', vendor, product)))) + r = self.session.get(urljoin(self.root_url, str(PurePosixPath('api', 'vulnerability', 'search', vendor, product)))) return r.json() # #### Comments #### diff --git a/tests/test_web.py b/tests/test_web.py index d33470c..5dc7767 100644 --- a/tests/test_web.py +++ b/tests/test_web.py @@ -269,7 +269,7 @@ class TestPublic(unittest.TestCase): return None for login in ['login', 'user', 'username', 'help', 'test', 'about', 'administration', 'account']: user = self.client.create_user(name='test Name', login=login, - organisation='test Organization', email='test@testorg.local') + organisation='test Organization', email='test@testorg.local') self.assertEqual(user['message'], 'Username not allowed.') def test_users_info(self) -> None: