From ddaf3946f20cfaeda03191734614fa08d119540c Mon Sep 17 00:00:00 2001 From: Cunliang Geng Date: Wed, 27 Nov 2024 15:01:32 +0100 Subject: [PATCH] update unit tests --- tests/integration/data/nplinker_local_mode.toml | 14 ++++++++++++-- tests/unit/data/nplinker_local_mode.toml | 14 ++++++++++++-- tests/unit/test_config.py | 7 +------ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/tests/integration/data/nplinker_local_mode.toml b/tests/integration/data/nplinker_local_mode.toml index 174ee852e..f578c8716 100644 --- a/tests/integration/data/nplinker_local_mode.toml +++ b/tests/integration/data/nplinker_local_mode.toml @@ -1,7 +1,17 @@ -dynaconf_merge = true # merge with the default settings, provided by the Dynaconf library - root_dir = "@format {env[NPLINKER_ROOT_DIR]}" mode = "local" [log] level = "DEBUG" +use_console = true + +[mibig] +to_use = true +version = "3.1" + +[bigscape] +version = 1 +cutoff = "0.30" + +[scoring] +methods = ["metcalf"] \ No newline at end of file diff --git a/tests/unit/data/nplinker_local_mode.toml b/tests/unit/data/nplinker_local_mode.toml index 174ee852e..f578c8716 100644 --- a/tests/unit/data/nplinker_local_mode.toml +++ b/tests/unit/data/nplinker_local_mode.toml @@ -1,7 +1,17 @@ -dynaconf_merge = true # merge with the default settings, provided by the Dynaconf library - root_dir = "@format {env[NPLINKER_ROOT_DIR]}" mode = "local" [log] level = "DEBUG" +use_console = true + +[mibig] +to_use = true +version = "3.1" + +[bigscape] +version = 1 +cutoff = "0.30" + +[scoring] +methods = ["metcalf"] \ No newline at end of file diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index ce2f24b79..23d5fa8ec 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -4,7 +4,7 @@ def test_config(tmp_path): - """Test loading the default config file.""" + """Test loading config file.""" os.environ["NPLINKER_ROOT_DIR"] = str(tmp_path) # Create a temporary root dir for NPLinker config = load_config(CONFIG_FILE_LOCAL_MODE) @@ -13,17 +13,12 @@ def test_config(tmp_path): assert config["log.level"] == "DEBUG" assert config.get("log.level") == "DEBUG" - # The following are default values from nplinker_default.toml assert config.get("log.file") is None assert config.log.use_console is True assert config.mibig.to_use is True assert config.mibig.version == "3.1" - assert ( - config.bigscape.parameters - == "--mibig --clans-off --mix --include_singletons --cutoffs 0.30" - ) assert config.bigscape.cutoff == "0.30" assert config.bigscape.version == 1