Skip to content
Snippets Groups Projects
test_annotation_mapping.py 599 B
Newer Older
Michał Pogoda's avatar
Michał Pogoda committed
from src.annotation_mapping import map_annotatios

def test_map_annotations():
    ref_annotations = [(0, 3, "Andrzej"), (7, 11, "psa")]
    all_annotations = {
        "A": [(0, 3, "Andrzej"), (7, 11, "psa")],
        "B": [(0, 3, "AndrzejB"), (7, 11, "psaA")],
        "C": [(0, 3, "AndrzejC"), (8, 9, "psaC")],
    }

    result = map_annotatios(ref_annotations, all_annotations, ["B", "C"])
    excepted = {
        (0, 3, "Andrzej"): {"B": (0, 3, "AndrzejB"), "C": (0, 3, "AndrzejC")},
        (7, 11, "psa"): {
            "B": (7, 11, "psaA"),
        },
    }

    assert result == excepted