diff options
| author | Arun Isaac | 2026-08-21 03:24:10 +0100 |
|---|---|---|
| committer | Arun Isaac | 2026-08-21 04:03:20 +0100 |
| commit | 5d65c47b0388b3e3fa50b8ddfbda4f417af4735f (patch) | |
| tree | c6e07b0dbae73f298b999651f3401c860faf911b /tests/test_domagi.py | |
| parent | 3f5edeb4e22c7af21b2f5463846ebdfd75f39360 (diff) | |
| download | domagi-5d65c47b0388b3e3fa50b8ddfbda4f417af4735f.tar.gz domagi-5d65c47b0388b3e3fa50b8ddfbda4f417af4735f.tar.lz domagi-5d65c47b0388b3e3fa50b8ddfbda4f417af4735f.zip | |
When testing, canonicalize links before comparing them.
Diffstat (limited to 'tests/test_domagi.py')
| -rw-r--r-- | tests/test_domagi.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_domagi.py b/tests/test_domagi.py index 3f63550..38c7c69 100644 --- a/tests/test_domagi.py +++ b/tests/test_domagi.py @@ -28,10 +28,19 @@ import pytest from domagi.domagi import main def assert_gfa_equal(expected, actual): + def invert_orientation(orientation): + return "-" if orientation=="+" else "+" + def process_gfa_line(line): fields = line.split("\t") if fields[0] == "L": - return fields[:5] + _, from_segment, from_orientation, to_segment, to_orientation = fields[:5] + if from_segment <= to_segment: + return ["L", from_segment, from_orientation, to_segment, to_orientation] + else: + return ["L", + to_segment, invert_orientation(to_orientation), + from_segment, invert_orientation(from_orientation)] elif fields[0] == "P": return fields[:3] else: |
