Skip to content

Commit

Permalink
fix: incorrect call for searching vendor and product
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Nov 26, 2024
1 parent e4a8994 commit 6db7ecf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions pyvulnerabilitylookup/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

import logging
import functools

from datetime import date, datetime
from importlib.metadata import version
Expand Down Expand Up @@ -68,14 +67,14 @@ def is_up(self) -> bool:

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]:
Expand Down Expand Up @@ -143,7 +142,7 @@ def get_vendor_product_vulnerabilities(self, vendor: str, product: str) -> list[
: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 ####
Expand Down
2 changes: 1 addition & 1 deletion tests/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def test_create_user_not_allowed_login(self) -> None:
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='[email protected]')
organisation='test Organization', email='[email protected]')
self.assertEqual(user['message'], 'Username not allowed.')

def test_users_info(self) -> None:
Expand Down

0 comments on commit 6db7ecf

Please sign in to comment.