From 1783136fa37cb502d07ce2e4bb0474cd3a0ff1f2 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 28 Aug 2026 00:46:37 +0100 Subject: Split subpaths selected by extract path range into discrete fragments. When `domagi extract` is given a path range, it may select discontinuous fragments of other paths. These fragments must be output as separate paths, not erroneously merged together. --- tests/test_domagi.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/test_domagi.py') diff --git a/tests/test_domagi.py b/tests/test_domagi.py index 8f92de6..ade24cd 100644 --- a/tests/test_domagi.py +++ b/tests/test_domagi.py @@ -265,6 +265,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): + 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", + "--out", output_duckdb_path]) + assert result.exit_code == 0 + result = runner.invoke(main, ["view", + "--to-gfa", + "--db", output_duckdb_path]) + assert result.exit_code == 0 + with open(expected_output) as file: + assert_gfa_equal(file, io.StringIO(result.stdout)) + @pytest.mark.parametrize("domagi_db_name, expected_output", [("domagi_db_test1", Path("test-data/expected-output/test1-matrix")), -- cgit 1.4.1