Skip to content

Commit d8f94a5

Browse files
committed
Add tests
Signed-off-by: Tushar Goel <[email protected]>
1 parent e79fc27 commit d8f94a5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# Copyright (c) nexB Inc. and others. All rights reserved.
3+
# VulnerableCode is a trademark of nexB Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+
# See https://github.com/nexB/vulnerablecode for support or download.
7+
# See https://aboutcode.org for more information about nexB OSS projects.
8+
#
9+
10+
import datetime
11+
12+
import pytest
13+
14+
from vulnerabilities.importers.nvd import NVDImporter
15+
from vulnerabilities.improve_runner import ImproveRunner
16+
from vulnerabilities.improvers.importer_specific_improver import NVDImprover
17+
from vulnerabilities.models import Advisory
18+
from vulnerabilities.models import Alias
19+
20+
21+
@pytest.mark.django_db
22+
def test_improvement_of_importer_specific_advisories():
23+
Advisory.objects.create(
24+
aliases=["CVE-2021-22"],
25+
summary="TEST",
26+
created_by=NVDImporter.qualified_name,
27+
date_collected=datetime.datetime.now(tz=datetime.timezone.utc),
28+
)
29+
ImproveRunner(NVDImprover).run()
30+
alias = Alias.objects.filter(alias="CVE-2021-22").first()
31+
assert alias is not None

0 commit comments

Comments
 (0)