Skip to content

Commit 0998cc7

Browse files
committed
Fix tests
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent 03fc65f commit 0998cc7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

vulnerabilities/pipelines/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,15 @@ def get_published_package_versions(
359359
"""
360360
versions_before_until = []
361361
try:
362-
if until and until.tzinfo is None:
363-
breakpoint()
364-
until = until.replace(tzinfo=timezone.utc)
365362
versions = package_versions.versions(str(package_url))
366363
for version in versions or []:
364+
if (
365+
version.release_date
366+
and version.release_date.tzinfo
367+
and until
368+
and until.tzinfo is None
369+
):
370+
until = until.replace(tzinfo=timezone.utc)
367371
if until and version.release_date and version.release_date > until:
368372
continue
369373
versions_before_until.append(version.value)

vulnerabilities/tests/pipelines/test_elixir_security_v2_importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_collect_advisories(mock_fetch_via_vcs, mock_vcs_response):
7272
assert len(advisories) == 1
7373

7474
advisory: AdvisoryData = advisories[0]
75-
assert advisory.advisory_id == "CVE-2022-9999"
75+
assert advisory.advisory_id == "some_package/CVE-2022-9999"
7676
assert advisory.summary.startswith("Cross-site scripting vulnerability")
7777
assert advisory.affected_packages[0].package.name == "plug"
7878
assert advisory.affected_packages[0].package.type == "hex"

0 commit comments

Comments
 (0)