コード例 #1
0
def test_match_empty_AB(mock_distance_func):

    A = []
    B = []
    Amatched, BmatchedSorted, Aunmatched, Bunmatched = split_matched_unmatched(
        A, B, mock_distance_func, 2)

    assert len(Amatched) == 0
    assert len(BmatchedSorted) == 0
    assert len(Aunmatched) == 0
    assert len(Bunmatched) == 0
コード例 #2
0
def test_match_empty_B(mock_distance_func):

    o1 = Object((('x', 0), ('y', 0)))
    o2 = Object((('x', 1), ('y', 0)))

    A = [o1, o2]
    B = []
    Amatched, BmatchedSorted, Aunmatched, Bunmatched = split_matched_unmatched(
        A, B, mock_distance_func, 2)

    assert Amatched == []
    assert BmatchedSorted == []
    assert Aunmatched == [o1, o2]
    assert Bunmatched == []
コード例 #3
0
def test_match_2A_within_distance(mock_distance_func):

    a1 = Object((('x', 0), ('y', 0)))
    a2 = Object((('x', 1.5), ('y', 0)))
    b1 = Object((('x', 1), ('y', 0)))
    b2 = Object((('x', 5), ('y', 0)))

    A = [a1, a2]
    B = [b1, b2]
    Amatched, BmatchedSorted, Aunmatched, Bunmatched = split_matched_unmatched(
        A, B, mock_distance_func, 2)

    assert Amatched == [a2]
    assert BmatchedSorted == [b1]
    assert Aunmatched == [a1]
    assert Bunmatched == [b2]