예제 #1
0
def test_at_location_multiple(tested):
    assert tested.at(Location(9, 13)) == [
        GenericLabel(9, 13, document=document, i=6),
        GenericLabel(9, 13, document=document, i=7),
    ]
예제 #2
0
def test_at_location_not_found(tested):
    assert tested.at(Location(10, 10)) == []
예제 #3
0
def test_at_location(tested):
    assert tested.at(Location(2, 6))[0] == GenericLabel(2,
                                                        6,
                                                        document=document,
                                                        i=2)
예제 #4
0
def test_label_location():
    l = GenericLabel(0, 10)
    assert l.location == Location(0, 10)
예제 #5
0
def test_location_equals():
    assert Location(1, 3) == Location(1, 3)
예제 #6
0
파일: test_labels.py 프로젝트: nlpie/mtap
def test_location_offset_by():
    first = Location(0, 5)
    assert first.offset_by(10) == Location(10, 15)
    assert first.offset_by(Location(10, 25)) == Location(10, 15)
    assert first.offset_by(GenericLabel(10, 25)) == Location(10, 15)
예제 #7
0
파일: test_labels.py 프로젝트: nlpie/mtap
def test_location_relative_to():
    first = Location(10, 20)
    assert first.relative_to(5) == Location(5, 15)
    assert first.relative_to(GenericLabel(5, 25)) == Location(5, 15)
    assert first.relative_to(Location(5, 25)) == Location(5, 15)