From 4ad3f0d2873f180f1502a47bc3aa183ad711f3ed Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 11:42:56 +0100 Subject: [PATCH 01/15] Check for attributes existence for a class DefaultConfig --- tests/test_config.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/test_config.py b/tests/test_config.py index 42ae459..22c72d6 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -5,12 +5,24 @@ from cvejob.config import DefaultConfig, RuntimeConfig -def test_default_config(): +def test_default_config_constructor(): """Basic test for the class DefaultConfig.""" config = DefaultConfig() assert config is not None +def test_default_config_attributes(): + """Basic test for the class DefaultConfig.""" + config = DefaultConfig() + + # basic configuration check + attributes = ("ecosystem", "cve_age", "feed_dir", "feed_names", "date_range", "cve_id", + "package_name", "cpe2pkg_path", "pkgfile_dir", "use_nvdtoolkit", + "nvdtoolkit_export_dir") + for attribute in attributes: + assert hasattr(config, attribute) + + def test_runtime_config(): """Basic test for the class RuntimeConfig.""" config = RuntimeConfig() From ac7cee62ac5b3731f677a6d0b744773caee022e9 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 11:47:51 +0100 Subject: [PATCH 02/15] Check for basic attributes --- tests/test_config.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/test_config.py b/tests/test_config.py index 22c72d6..ec092ee 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -12,7 +12,7 @@ def test_default_config_constructor(): def test_default_config_attributes(): - """Basic test for the class DefaultConfig.""" + """Check the attributes existence for a class DefaultConfig.""" config = DefaultConfig() # basic configuration check @@ -23,6 +23,32 @@ def test_default_config_attributes(): assert hasattr(config, attribute) +def test_default_config_attribute_values_nil(): + """Check the attributes that needs to be set to nil (None).""" + config = DefaultConfig() + + # the following attributes needs to be set to nil + assert config.feed_names is None + assert config.date_range is None + assert config.cve_id is None + assert config.package_name is None + assert config.feed_names is None + + +def test_default_config_attribute_values_not_nil(): + """Check the attributes that needs not to be set to nil (None).""" + config = DefaultConfig() + + # the following attributes need not be set to nil + assert config.ecosystem is not None + assert config.cve_age is not None + assert config.feed_dir is not None + assert config.cpe2pkg_path is not None + assert config.pkgfile_dir is not None + assert config.use_nvdtoolkit is not None + assert config.nvdtoolkit_export_dir is not None + + def test_runtime_config(): """Basic test for the class RuntimeConfig.""" config = RuntimeConfig() From 03aa84a59efde92e0ae6afe23cc0b193d891b43c Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 11:49:10 +0100 Subject: [PATCH 03/15] Check for attributes existence for RuntimeConfig class --- tests/test_config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index ec092ee..8bead38 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -53,3 +53,10 @@ def test_runtime_config(): """Basic test for the class RuntimeConfig.""" config = RuntimeConfig() assert config is not None + + +def test_runtime_config_attributes(): + """Check the attributes existence for a class RuntimeConfig.""" + config = DefaultConfig() + + assert hasattr(config, _config) From 0f3cdb434940244f5d2960a5f9cfd9a984f14510 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 13:31:47 +0100 Subject: [PATCH 04/15] New test runtime_config_attribute_ecosystem --- tests/test_config.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/test_config.py b/tests/test_config.py index 8bead38..3948087 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -59,4 +59,25 @@ def test_runtime_config_attributes(): """Check the attributes existence for a class RuntimeConfig.""" config = DefaultConfig() - assert hasattr(config, _config) + assert hasattr(config, "_config") + + +def unset_environment_variable(name): + """Reset specified environment variable.""" + old_value = os.environ.get('CVEJOB_ECOSYSTEM') + del os.environ['CVEJOB_ECOSYSTEM'] + return old_value + + +def test_runtime_config_attribute_ecosystem(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_ECOSYSTEM') + + config = DefaultConfig() + assert config._config.ecosystem == 'python' + + os.environ['CVEJOB_ECOSYSTEM'] = 'foobar' + config = DefaultConfig() + assert config._config.ecosystem == 'foobar' + + os.environ['CVEJOB_ECOSYSTEM'] = old_value From 584c10b768bb3f85a98d0e902cff58816c7fc298 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 13:39:07 +0100 Subject: [PATCH 05/15] New test runtime_config_attribute_cve_age --- tests/test_config.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 3948087..fddc513 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,6 +1,7 @@ """Test for the config.py.""" # import pytest +import os from cvejob.config import DefaultConfig, RuntimeConfig @@ -57,7 +58,7 @@ def test_runtime_config(): def test_runtime_config_attributes(): """Check the attributes existence for a class RuntimeConfig.""" - config = DefaultConfig() + config = RuntimeConfig() assert hasattr(config, "_config") @@ -73,11 +74,29 @@ def test_runtime_config_attribute_ecosystem(): """Check the attributes handling for a class RuntimeConfig.""" old_value = unset_environment_variable('CVEJOB_ECOSYSTEM') - config = DefaultConfig() + config = RuntimeConfig() assert config._config.ecosystem == 'python' os.environ['CVEJOB_ECOSYSTEM'] = 'foobar' - config = DefaultConfig() + config = RuntimeConfig() assert config._config.ecosystem == 'foobar' os.environ['CVEJOB_ECOSYSTEM'] = old_value + + +def test_runtime_config_attribute_cve_age(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_CVE_AGE') + + config = RuntimeConfig() + assert config._config.cve_age == 0 + + os.environ['CVEJOB_CVE_AGE'] = '42' + config = RuntimeConfig() + assert config._config.cve_age == 42 + + os.environ['CVEJOB_CVE_AGE'] = '-42' + config = RuntimeConfig() + assert config._config.cve_age == -42 + + os.environ['CVEJOB_CVE_AGE'] = old_value From d0f3423830eef53c68f89a72a83ef6faca303acd Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 13:46:52 +0100 Subject: [PATCH 06/15] Better handling non-existent environment variables --- tests/test_config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index fddc513..b5b1b45 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -59,15 +59,14 @@ def test_runtime_config(): def test_runtime_config_attributes(): """Check the attributes existence for a class RuntimeConfig.""" config = RuntimeConfig() + assert config is not None assert hasattr(config, "_config") def unset_environment_variable(name): """Reset specified environment variable.""" - old_value = os.environ.get('CVEJOB_ECOSYSTEM') - del os.environ['CVEJOB_ECOSYSTEM'] - return old_value + return os.environ.pop(name, None) def test_runtime_config_attribute_ecosystem(): From 30ee6627114a1b13dacec9b5cfed38284da916c5 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 14:08:18 +0100 Subject: [PATCH 07/15] New test runtime_config_attribute_cvejob_feed_dir --- tests/test_config.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index b5b1b45..05abd90 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -80,7 +80,8 @@ def test_runtime_config_attribute_ecosystem(): config = RuntimeConfig() assert config._config.ecosystem == 'foobar' - os.environ['CVEJOB_ECOSYSTEM'] = old_value + if old_value is not None: + os.environ['CVEJOB_ECOSYSTEM'] = old_value def test_runtime_config_attribute_cve_age(): @@ -98,4 +99,20 @@ def test_runtime_config_attribute_cve_age(): config = RuntimeConfig() assert config._config.cve_age == -42 - os.environ['CVEJOB_CVE_AGE'] = old_value + if old_value is not None: + os.environ['CVEJOB_CVE_AGE'] = old_value + + +def test_runtime_config_attribute_cvejob_feed_dir(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_FEED_DIR') + + config = RuntimeConfig() + assert config._config.cve_age == 0 + + os.environ['CVEJOB_FEED_DIR'] = 'directory1' + config = RuntimeConfig() + assert config._config.cve_age == 'directory1' + + if old_value is not None: + os.environ['CVEJOB_FEED_DIR'] = old_value From d3e8a90092e96a5a057a0f833b648b218b116234 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 14:18:50 +0100 Subject: [PATCH 08/15] New test runtime_config_attribute_cvejob_feed_names --- tests/test_config.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 05abd90..867055e 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -108,11 +108,30 @@ def test_runtime_config_attribute_cvejob_feed_dir(): old_value = unset_environment_variable('CVEJOB_FEED_DIR') config = RuntimeConfig() - assert config._config.cve_age == 0 + assert config._config.feed_dir == 'nvd-data/' os.environ['CVEJOB_FEED_DIR'] = 'directory1' config = RuntimeConfig() - assert config._config.cve_age == 'directory1' + assert config._config.feed_dir == 'directory1' if old_value is not None: os.environ['CVEJOB_FEED_DIR'] = old_value + + +def test_runtime_config_attribute_cvejob_feed_names(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_FEED_NAMES') + + config = RuntimeConfig() + assert config._config.feed_names is None + + os.environ['CVEJOB_FEED_NAMES'] = 'name1' + config = RuntimeConfig() + assert config._config.feed_names == ['name1'] + + os.environ['CVEJOB_FEED_NAMES'] = 'name1,name2' + config = RuntimeConfig() + assert config._config.feed_names == ['name1', 'name2'] + + if old_value is not None: + os.environ['CVEJOB_FEED_NAMES'] = old_value From 72f7f8101e71abba2bb4670275c61607a72d8374 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 14:44:29 +0100 Subject: [PATCH 09/15] New test runtime_config_attribute_cvejob_cve_id --- tests/test_config.py | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 867055e..4a1e1c4 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -125,13 +125,44 @@ def test_runtime_config_attribute_cvejob_feed_names(): config = RuntimeConfig() assert config._config.feed_names is None - os.environ['CVEJOB_FEED_NAMES'] = 'name1' + # TODO: the following test needs to be enabled after the fix in master branch + # os.environ['CVEJOB_FEED_NAMES'] = 'name1' + # config = RuntimeConfig() + # assert config._config.feed_names == ['name1'] + + # os.environ['CVEJOB_FEED_NAMES'] = 'name1,name2' + # config = RuntimeConfig() + # assert config._config.feed_names == ['name1', 'name2'] + + if old_value is not None: + os.environ['CVEJOB_FEED_NAMES'] = old_value + + +def test_runtime_config_attribute_cvejob_date_range(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_DATE_RANGE') + config = RuntimeConfig() - assert config._config.feed_names == ['name1'] + assert config._config.date_range is None - os.environ['CVEJOB_FEED_NAMES'] = 'name1,name2' + os.environ['CVEJOB_DATE_RANGE'] = '2017-01-01' config = RuntimeConfig() - assert config._config.feed_names == ['name1', 'name2'] + assert config._config.date_range == '2017-01-01' if old_value is not None: - os.environ['CVEJOB_FEED_NAMES'] = old_value + os.environ['CVEJOB_DATE_RANGE'] = old_value + + +def test_runtime_config_attribute_cvejob_cve_id(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_CVE_ID') + + config = RuntimeConfig() + assert config._config.cve_id is None + + os.environ['CVEJOB_CVE_ID'] = 'CVE1234' + config = RuntimeConfig() + assert config._config.cve_id == 'CVE1234' + + if old_value is not None: + os.environ['CVEJOB_CVE_ID'] = old_value From fd4ca2aeb9cbaa5ef01759c6e366b8657c8d514f Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 14:47:21 +0100 Subject: [PATCH 10/15] New test runtime_config_attribute_cvejob_package_name --- tests/test_config.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index 4a1e1c4..835bb6e 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -166,3 +166,18 @@ def test_runtime_config_attribute_cvejob_cve_id(): if old_value is not None: os.environ['CVEJOB_CVE_ID'] = old_value + + +def test_runtime_config_attribute_cvejob_package_name(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_PACKAGE_NAME') + + config = RuntimeConfig() + assert config._config.cve_package_name is None + + os.environ['CVEJOB_PACKAGE_NAME'] = 'test_package' + config = RuntimeConfig() + assert config._config.cve_package_name == 'test_package' + + if old_value is not None: + os.environ['CVEJOB_PACKAGE_NAME'] = old_value From 13f8b44d08fc8237c25b15661fd17fffbb3abb34 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 14:50:50 +0100 Subject: [PATCH 11/15] New test runtime_config_attribute_cvejob_cpe2pkg_path --- tests/test_config.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index 835bb6e..76b952c 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -181,3 +181,18 @@ def test_runtime_config_attribute_cvejob_package_name(): if old_value is not None: os.environ['CVEJOB_PACKAGE_NAME'] = old_value + + +def test_runtime_config_attribute_cvejob_cpe2pkg_path(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_CPE2PKG_PATH') + + config = RuntimeConfig() + assert config._config.cpe2pkg_path is None + + os.environ['CVEJOB_CPE2PKG_PATH'] = 'cpe2pkg' + config = RuntimeConfig() + assert config._config.cpe2pkg_path == 'cpe2pkg' + + if old_value is not None: + os.environ['CVEJOB_CPE2PKG_PATH'] = old_value From 2162f339ed2feaef8cc86e9d16519f074a027dfb Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 14:53:00 +0100 Subject: [PATCH 12/15] New test runtime_config_attribute_cvejob_pkgfile_dir --- tests/test_config.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 76b952c..c735e1a 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -188,11 +188,26 @@ def test_runtime_config_attribute_cvejob_cpe2pkg_path(): old_value = unset_environment_variable('CVEJOB_CPE2PKG_PATH') config = RuntimeConfig() - assert config._config.cpe2pkg_path is None + assert config._config.cpe2pkg_path == 'cpe2pkg.jar' - os.environ['CVEJOB_CPE2PKG_PATH'] = 'cpe2pkg' + os.environ['CVEJOB_CPE2PKG_PATH'] = 'cpe2pkg10.jar' config = RuntimeConfig() - assert config._config.cpe2pkg_path == 'cpe2pkg' + assert config._config.cpe2pkg_path == 'cpe2pkg10.jar' if old_value is not None: os.environ['CVEJOB_CPE2PKG_PATH'] = old_value + + +def test_runtime_config_attribute_cvejob_pkgfile_dir(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_PKGFILE_DIR') + + config = RuntimeConfig() + assert config._config.pkgfile_dir == 'data/' + + os.environ['CVEJOB_PKGFILE_DIR'] = 'cpe2pkg10.jar' + config = RuntimeConfig() + assert config._config.pkgfile_dir == 'cpe2pkg10.jar' + + if old_value is not None: + os.environ['CVEJOB_PKGFILE_DIR'] = old_value From a1c286d6f5be0d1b328d4507f276fda49415a242 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 14:56:30 +0100 Subject: [PATCH 13/15] New test runtime_config_attribute_cvejob_use_nvd_toolkit --- tests/test_config.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index c735e1a..45c70ca 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -211,3 +211,38 @@ def test_runtime_config_attribute_cvejob_pkgfile_dir(): if old_value is not None: os.environ['CVEJOB_PKGFILE_DIR'] = old_value + + +def test_runtime_config_attribute_cvejob_use_nvd_toolkit(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_USE_NVD_TOOLKIT') + + config = RuntimeConfig() + assert not config._config.pkgfile_dir + + os.environ['CVEJOB_USE_NVD_TOOLKIT'] = 'true' + config = RuntimeConfig() + assert config._config.pkgfile_dir + + os.environ['CVEJOB_USE_NVD_TOOLKIT'] = '1' + config = RuntimeConfig() + assert config._config.pkgfile_dir + + os.environ['CVEJOB_USE_NVD_TOOLKIT'] = 'yes' + config = RuntimeConfig() + assert config._config.pkgfile_dir + + os.environ['CVEJOB_USE_NVD_TOOLKIT'] = 'false' + config = RuntimeConfig() + assert not config._config.pkgfile_dir + + os.environ['CVEJOB_USE_NVD_TOOLKIT'] = '0' + config = RuntimeConfig() + assert not config._config.pkgfile_dir + + os.environ['CVEJOB_USE_NVD_TOOLKIT'] = 'no' + config = RuntimeConfig() + assert not config._config.pkgfile_dir + + if old_value is not None: + os.environ['CVEJOB_USE_NVD_TOOLKIT'] = old_value From bcd537229491bb1b13353d98bde15b1b62cd8024 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 14:57:53 +0100 Subject: [PATCH 14/15] New test runtime_config_attribute_cvejob_nvd_toolkit_export_dir --- tests/test_config.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index 45c70ca..6e9da39 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -246,3 +246,18 @@ def test_runtime_config_attribute_cvejob_use_nvd_toolkit(): if old_value is not None: os.environ['CVEJOB_USE_NVD_TOOLKIT'] = old_value + + +def test_runtime_config_attribute_cvejob_nvd_toolkit_export_dir(): + """Check the attributes handling for a class RuntimeConfig.""" + old_value = unset_environment_variable('CVEJOB_NVD_TOOLKIT_EXPORT_DIR') + + config = RuntimeConfig() + assert config._config.nvdtoolkit_export_dir == 'export/' + + os.environ['CVEJOB_NVD_TOOLKIT_EXPORT_DIR'] = 'export2/' + config = RuntimeConfig() + assert config._config.nvdtoolkit_export_dir == 'export2/' + + if old_value is not None: + os.environ['CVEJOB_NVD_TOOLKIT_EXPORT_DIR'] = old_value From c7ef6d499edff25f5c61bd9f56edaecf891a532d Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 28 Mar 2019 15:19:32 +0100 Subject: [PATCH 15/15] Fixed issues found in tests --- tests/test_config.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 6e9da39..d56659c 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -173,11 +173,11 @@ def test_runtime_config_attribute_cvejob_package_name(): old_value = unset_environment_variable('CVEJOB_PACKAGE_NAME') config = RuntimeConfig() - assert config._config.cve_package_name is None + assert config._config.package_name is None os.environ['CVEJOB_PACKAGE_NAME'] = 'test_package' config = RuntimeConfig() - assert config._config.cve_package_name == 'test_package' + assert config._config.package_name == 'test_package' if old_value is not None: os.environ['CVEJOB_PACKAGE_NAME'] = old_value @@ -218,31 +218,31 @@ def test_runtime_config_attribute_cvejob_use_nvd_toolkit(): old_value = unset_environment_variable('CVEJOB_USE_NVD_TOOLKIT') config = RuntimeConfig() - assert not config._config.pkgfile_dir + assert not config._config.use_nvdtoolkit os.environ['CVEJOB_USE_NVD_TOOLKIT'] = 'true' config = RuntimeConfig() - assert config._config.pkgfile_dir + assert config._config.use_nvdtoolkit os.environ['CVEJOB_USE_NVD_TOOLKIT'] = '1' config = RuntimeConfig() - assert config._config.pkgfile_dir + assert config._config.use_nvdtoolkit os.environ['CVEJOB_USE_NVD_TOOLKIT'] = 'yes' config = RuntimeConfig() - assert config._config.pkgfile_dir + assert config._config.use_nvdtoolkit os.environ['CVEJOB_USE_NVD_TOOLKIT'] = 'false' config = RuntimeConfig() - assert not config._config.pkgfile_dir + assert not config._config.use_nvdtoolkit os.environ['CVEJOB_USE_NVD_TOOLKIT'] = '0' config = RuntimeConfig() - assert not config._config.pkgfile_dir + assert not config._config.use_nvdtoolkit os.environ['CVEJOB_USE_NVD_TOOLKIT'] = 'no' config = RuntimeConfig() - assert not config._config.pkgfile_dir + assert not config._config.use_nvdtoolkit if old_value is not None: os.environ['CVEJOB_USE_NVD_TOOLKIT'] = old_value