Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating tests #18

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements/common.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
requests==2.20.0
requests==2.20.0
5 changes: 4 additions & 1 deletion tests/test_advisory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import unittest
from unittest import mock
import requests

from openVulnQuery import advisory
from openVulnQuery import constants

Expand Down Expand Up @@ -148,7 +151,7 @@ def test_advisory_advisory_factory_cvrf_with_key_cvrf_url_and_ips(self):
adv_map[v] = k
self.assertTrue(advisory.advisory_factory(
adv_map,
constants.CVRF_ADVISORY_FORMAT_TOKEN,
constants.DEFAULT_ADVISORY_FORMAT_TOKEN,
MockLogger()))

def test_advisory_advisory_factory_oval_with_key_oval_url_and_ips(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_authorization.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

import mock
import requests
from unittest import mock

from openVulnQuery import authorization
from openVulnQuery import config

Expand Down
1 change: 1 addition & 0 deletions tests/test_cli_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import unittest
import os
import inspect
import requests

from openVulnQuery import config
from openVulnQuery import cli_api
Expand Down
2 changes: 2 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import os
import unittest
import requests
from unittest import mock

from openVulnQuery import config

Expand Down
13 changes: 5 additions & 8 deletions tests/test_constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import unittest
import requests
from unittest import mock

from openVulnQuery import constants

Expand Down Expand Up @@ -41,13 +43,11 @@
JSON_OUTPUT_FORMAT_TOKEN = 'json'
CSV_OUTPUT_FORMAT_TOKEN = 'csv'

CVRF_ADVISORY_FORMAT_TOKEN = 'cvrf'
OVAL_ADVISORY_FORMAT_TOKEN = 'oval'
DEFAULT_ADVISORY_FORMAT_TOKEN = 'default'
IOS_ADVISORY_FORMAT_TOKEN = 'ios'

ADVISORY_FORMAT_TOKENS = (
CVRF_ADVISORY_FORMAT_TOKEN,
OVAL_ADVISORY_FORMAT_TOKEN,
DEFAULT_ADVISORY_FORMAT_TOKEN,
IOS_ADVISORY_FORMAT_TOKEN,
)

Expand All @@ -73,11 +73,8 @@ def test_constants_unchanged_csv_format_token(self):

def test_constants_unchanged_cvrf_advisory_format_token(self):
self.assertEqual(
constants.CVRF_ADVISORY_FORMAT_TOKEN, CVRF_ADVISORY_FORMAT_TOKEN)
constants.DEFAULT_ADVISORY_FORMAT_TOKEN, DEFAULT_ADVISORY_FORMAT_TOKEN)

def test_constants_unchanged_oval_advisory_format_token(self):
self.assertEqual(
constants.OVAL_ADVISORY_FORMAT_TOKEN, OVAL_ADVISORY_FORMAT_TOKEN)

def test_constants_unchanged_ios_advisory_format_token(self):
self.assertEqual(
Expand Down
2 changes: 2 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import unittest
from unittest import mock
import requests

from openVulnQuery import advisory
from openVulnQuery import config
Expand Down
4 changes: 3 additions & 1 deletion tests/test_query_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import unittest
import mock
import requests
import json

from unittest import mock

from openVulnQuery import query_client
from openVulnQuery import constants
from openVulnQuery import config
Expand Down
3 changes: 2 additions & 1 deletion tests/test_query_client_cvrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import unittest
import pytest

import mock
from unittest import mock

from openVulnQuery import advisory
from openVulnQuery import config
from openVulnQuery import query_client
Expand Down
1 change: 0 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import unittest
import mock
import sys
import json
import pytest
Expand Down