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

chore: improve unit tests in debian provider #311

Merged
merged 1 commit into from
Oct 3, 2023
Merged
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
3 changes: 3 additions & 0 deletions tests/unit/providers/debian/test_debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os.path
import shutil
from unittest.mock import MagicMock

import pytest
from vunnel import result, workspace
Expand Down Expand Up @@ -68,6 +69,7 @@ def test_get_dsa_map(self, tmpdir, helpers, disable_get_requests):

def test_normalize_json(self, tmpdir, helpers, disable_get_requests):
subject = parser.Parser(workspace=workspace.Workspace(tmpdir, "test", create=True))
subject.logger = MagicMock()

dsa_mock_data_path = helpers.local_dir(self._sample_dsa_data_)
json_mock_data_path = helpers.local_dir(self._sample_json_data_)
Expand All @@ -88,6 +90,7 @@ def test_normalize_json(self, tmpdir, helpers, disable_get_requests):
assert all(x.get("Vulnerability", {}).get("Name") for x in vuln_dict.values())

assert all(x.get("Vulnerability", {}).get("Description") is not None for x in vuln_dict.values())
assert not subject.logger.exception.called, "no exceptions should be logged"

def test_get_legacy_records(self, tmpdir, helpers, disable_get_requests):
subject = parser.Parser(workspace=workspace.Workspace(tmpdir, "test", create=True))
Expand Down