about summary refs log tree commit diff
path: root/tests/test_domagi.py
diff options
context:
space:
mode:
authorArun Isaac2026-08-28 03:05:32 +0100
committerArun Isaac2026-08-28 14:45:26 +0100
commit586428723f40d929f3ef9402352378c6d6629841 (patch)
tree4397dff7be322ab098ffe34ef46f8f85528683cc /tests/test_domagi.py
parent1783136fa37cb502d07ce2e4bb0474cd3a0ff1f2 (diff)
downloaddomagi-586428723f40d929f3ef9402352378c6d6629841.tar.gz
domagi-586428723f40d929f3ef9402352378c6d6629841.tar.lz
domagi-586428723f40d929f3ef9402352378c6d6629841.zip
Bridge extracted subpaths. HEAD main
Diffstat (limited to 'tests/test_domagi.py')
-rw-r--r--tests/test_domagi.py28
1 files changed, 21 insertions, 7 deletions
diff --git a/tests/test_domagi.py b/tests/test_domagi.py
index ade24cd..d12ce42 100644
--- a/tests/test_domagi.py
+++ b/tests/test_domagi.py
@@ -80,6 +80,11 @@ def domagi_db_testcrush(tmp_path_factory):
     return build_db(Path("test-data/test-crush.gfa"),
                     tmp_path_factory.mktemp("db") / "test-crush.db")
 
+@pytest.fixture(scope="session")
+def domagi_db_testextractpathbridge(tmp_path_factory):
+    return build_db(Path("test-data/test-extract-path-bridge.gfa"),
+                    tmp_path_factory.mktemp("db") / "test-extract-path-bridge.db")
+
 @pytest.mark.parametrize("domagi_db_name, chop_to, expected_output",
                          [("domagi_db_test3",
                            1,
@@ -265,18 +270,27 @@ def test_domagi_extract_path(tmp_path, request, domagi_db_name, path_range, expe
     with open(expected_output) as file:
         assert_gfa_equal(file, io.StringIO(result.stdout))
 
-@pytest.mark.parametrize("domagi_db_name, path_range, expected_output",
-                         [("domagi_db_test1",
-                           "x:10-20",
-                           Path("test-data/expected-output/test1-extract-path-no-bridge-10-20.gfa"))])
-def test_domagi_extract_path_no_bridge(tmp_path, request, domagi_db_name, path_range, expected_output):
+@pytest.mark.parametrize("domagi_db_name, max_distance_subpaths, expected_output",
+                         [("domagi_db_testextractpathbridge",
+                           0,
+                           Path("test-data/expected-output/test-extract-path-bridge-0.gfa")),
+                          ("domagi_db_testextractpathbridge",
+                           1,
+                           Path("test-data/expected-output/test-extract-path-bridge-1.gfa")),
+                          ("domagi_db_testextractpathbridge",
+                           2,
+                           Path("test-data/expected-output/test-extract-path-bridge-2.gfa")),
+                          ("domagi_db_testextractpathbridge",
+                           3,
+                           Path("test-data/expected-output/test-extract-path-bridge-3.gfa"))])
+def test_domagi_extract_path_bridge(tmp_path, request, domagi_db_name, max_distance_subpaths, expected_output):
     domagi_db = request.getfixturevalue(domagi_db_name)
     output_duckdb_path = tmp_path / f"{domagi_db.stem}-output.db"
     runner = CliRunner()
     result = runner.invoke(main, ["extract",
                                   "--db", domagi_db,
-                                  "--path-range", path_range,
-                                  "--max-distance-subpaths", "0",
+                                  "--path-range", "x:10-20",
+                                  "--max-distance-subpaths", str(max_distance_subpaths),
                                   "--out", output_duckdb_path])
     assert result.exit_code == 0
     result = runner.invoke(main, ["view",