From 70e5632e869d9a19a338b5de9cfb8ab83bea15ef Mon Sep 17 00:00:00 2001 From: "John M. Horan" Date: Sat, 8 Jun 2024 11:19:48 -0700 Subject: [PATCH] Fix failing tests, clean merged code as needed #65 Reference: Signed-off-by: John M. Horan --- purldb-toolkit/README.rst | 4 ---- purldb-toolkit/src/purldb_toolkit/purlcli.py | 9 ------- purldb-toolkit/tests/test_purlcli_live.py | 25 ++++++++++---------- 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/purldb-toolkit/README.rst b/purldb-toolkit/README.rst index f394e585..bbfdd69b 100644 --- a/purldb-toolkit/README.rst +++ b/purldb-toolkit/README.rst @@ -154,10 +154,6 @@ This command collects and return a list of all the known versions of a PURL by q and upstream package registries as needed. -This command collects and return a list of all the known versions of a PURL by querying the PurlDB -and upstream package registries as needed. - - Examples ######## diff --git a/purldb-toolkit/src/purldb_toolkit/purlcli.py b/purldb-toolkit/src/purldb_toolkit/purlcli.py index 2b0cfaaf..2017f63b 100644 --- a/purldb-toolkit/src/purldb_toolkit/purlcli.py +++ b/purldb-toolkit/src/purldb_toolkit/purlcli.py @@ -28,8 +28,6 @@ # in seconds POLLING_INTERVAL = 5 -LOG_FILE_LOCATION = os.path.join(os.path.expanduser("~"), "purlcli.log") - @click.group() def purlcli(): @@ -503,13 +501,6 @@ def check_for_duplicate_input_sources(purls, file): raise click.UsageError("Use either purls or file.") -def clear_log_file(): - log_file = Path(LOG_FILE_LOCATION) - - if log_file.is_file(): - os.remove(log_file) - - class D2DPackage(NamedTuple): """ A package to use in d2d, identifier by its PURL and qualified by is package_content which is one diff --git a/purldb-toolkit/tests/test_purlcli_live.py b/purldb-toolkit/tests/test_purlcli_live.py index 53765375..53068965 100644 --- a/purldb-toolkit/tests/test_purlcli_live.py +++ b/purldb-toolkit/tests/test_purlcli_live.py @@ -10,7 +10,6 @@ import json import os from collections import OrderedDict -from unittest import mock import pytest from click.testing import CliRunner @@ -162,9 +161,6 @@ def test_metadata_details(self): ("version", None), ("qualifiers", OrderedDict()), ("subpath", None), - ("repository_homepage_url", None), - ("repository_download_url", None), - ("api_data_url", None), ("primary_language", None), ("description", None), ("release_date", None), @@ -189,6 +185,9 @@ def test_metadata_details(self): ("dependencies", []), ("contains_source_code", None), ("source_packages", []), + ("repository_homepage_url", None), + ("repository_download_url", None), + ("api_data_url", None), ] ), OrderedDict( @@ -200,9 +199,6 @@ def test_metadata_details(self): ("version", "0.1.0"), ("qualifiers", OrderedDict()), ("subpath", None), - ("repository_homepage_url", None), - ("repository_download_url", None), - ("api_data_url", None), ("primary_language", None), ("description", None), ("release_date", None), @@ -230,6 +226,9 @@ def test_metadata_details(self): ("dependencies", []), ("contains_source_code", None), ("source_packages", []), + ("repository_homepage_url", None), + ("repository_download_url", None), + ("api_data_url", None), ] ), OrderedDict( @@ -241,9 +240,6 @@ def test_metadata_details(self): ("version", "0.2.0"), ("qualifiers", OrderedDict()), ("subpath", None), - ("repository_homepage_url", None), - ("repository_download_url", None), - ("api_data_url", None), ("primary_language", None), ("description", None), ("release_date", None), @@ -271,6 +267,9 @@ def test_metadata_details(self): ("dependencies", []), ("contains_source_code", None), ("source_packages", []), + ("repository_homepage_url", None), + ("repository_download_url", None), + ("api_data_url", None), ] ), OrderedDict( @@ -282,9 +281,6 @@ def test_metadata_details(self): ("version", "0.3.0"), ("qualifiers", OrderedDict()), ("subpath", None), - ("repository_homepage_url", None), - ("repository_download_url", None), - ("api_data_url", None), ("primary_language", None), ("description", None), ("release_date", None), @@ -312,6 +308,9 @@ def test_metadata_details(self): ("dependencies", []), ("contains_source_code", None), ("source_packages", []), + ("repository_homepage_url", None), + ("repository_download_url", None), + ("api_data_url", None), ] ), ],