Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CunliangGeng committed Nov 27, 2024
1 parent 3146847 commit ddaf394
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
14 changes: 12 additions & 2 deletions tests/integration/data/nplinker_local_mode.toml
Original file line number Diff line number Diff line change
@@ -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"]
14 changes: 12 additions & 2 deletions tests/unit/data/nplinker_local_mode.toml
Original file line number Diff line number Diff line change
@@ -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"]
7 changes: 1 addition & 6 deletions tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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

Expand Down

0 comments on commit ddaf394

Please sign in to comment.