mirror of
https://github.com/cve-search/PyVulnerabilityLookup.git
synced 2024-11-25 16:27:23 +00:00
fix: make sure the test suite works in local
This commit is contained in:
parent
51bcb96d61
commit
390629aa49
1 changed files with 15 additions and 3 deletions
|
@ -133,6 +133,10 @@ class TestPublic(unittest.TestCase):
|
||||||
comments["data"][0]["uuid"], "a309d024-2714-4a81-a425-60f83f6d5740"
|
comments["data"][0]["uuid"], "a309d024-2714-4a81-a425-60f83f6d5740"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
comment = self.client.get_comment("a309d024-2714-4a81-a425-60f83f6d5740")
|
||||||
|
self.assertEqual(
|
||||||
|
comment["uuid"], "a309d024-2714-4a81-a425-60f83f6d5740"
|
||||||
|
)
|
||||||
comments = self.client.get_comments(uuid="a309d024-2714-4a81-a425-60f83f6d5740")
|
comments = self.client.get_comments(uuid="a309d024-2714-4a81-a425-60f83f6d5740")
|
||||||
self.assertTrue(len(comments["data"]) == 1)
|
self.assertTrue(len(comments["data"]) == 1)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
@ -293,9 +297,11 @@ class TestPublic(unittest.TestCase):
|
||||||
if not instance_config.get('registration'):
|
if not instance_config.get('registration'):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
user = self.client.create_user(name='test Name', login='test Login',
|
user = self.client.create_user(name='test_Name', login='test_Login',
|
||||||
organisation='test Organization', email='test@testorg.lu')
|
organisation='test Organization', email='test@testorg.local')
|
||||||
self.assertTrue(user)
|
self.assertTrue(user)
|
||||||
|
self.assertTrue('id' in user, user)
|
||||||
|
uid = user['id']
|
||||||
self.assertTrue('login' in user, user)
|
self.assertTrue('login' in user, user)
|
||||||
self.assertTrue('apikey' in user, user)
|
self.assertTrue('apikey' in user, user)
|
||||||
self.assertTrue('is_commenter' in user, user)
|
self.assertTrue('is_commenter' in user, user)
|
||||||
|
@ -311,8 +317,14 @@ class TestPublic(unittest.TestCase):
|
||||||
deleted_comment = self.client.delete_comment(new_comment_uuid)
|
deleted_comment = self.client.delete_comment(new_comment_uuid)
|
||||||
self.assertTrue(deleted_comment < 300)
|
self.assertTrue(deleted_comment < 300)
|
||||||
|
|
||||||
|
self.client.set_apikey(self.admin_token)
|
||||||
|
deleted_user = self.client.delete_user(str(uid))
|
||||||
|
self.assertTrue(deleted_user < 300)
|
||||||
|
|
||||||
# test Sightings
|
# test Sightings
|
||||||
def test_sightings(self) -> None:
|
def test_sightings_public(self) -> None:
|
||||||
|
if not self.public_test:
|
||||||
|
return None
|
||||||
sighting_cve = self.client.get_sighting('6febe45d-d8de-4df7-b3ba-6cf7acd2e2b5')
|
sighting_cve = self.client.get_sighting('6febe45d-d8de-4df7-b3ba-6cf7acd2e2b5')
|
||||||
self.assertTrue(sighting_cve)
|
self.assertTrue(sighting_cve)
|
||||||
self.assertTrue('uuid' in sighting_cve)
|
self.assertTrue('uuid' in sighting_cve)
|
||||||
|
|
Loading…
Reference in a new issue