diff options
| author | Arun Isaac | 2026-08-28 00:46:37 +0100 |
|---|---|---|
| committer | Arun Isaac | 2026-08-28 03:01:35 +0100 |
| commit | 1783136fa37cb502d07ce2e4bb0474cd3a0ff1f2 (patch) | |
| tree | 627216bee7bb53b15f41fc02b0851b0d7e7487cd /tests | |
| parent | 427d6d4f08be08864a414655786368d58b8d6485 (diff) | |
| download | domagi-1783136fa37cb502d07ce2e4bb0474cd3a0ff1f2.tar.gz domagi-1783136fa37cb502d07ce2e4bb0474cd3a0ff1f2.tar.lz domagi-1783136fa37cb502d07ce2e4bb0474cd3a0ff1f2.zip | |
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.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_domagi.py | 21 |
1 files changed, 21 insertions, 0 deletions
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")), |
