示例#1
0
def test_element_similarity_must_return_expected_ratio(string_type):
    e = Element(name='Name', element_type=string_type)
    new_e = Element(name='NewName', element_type=string_type)

    assert e.similarity(new_e) == 0.8636363636363636

    e = Element(name='Name', element_type=string_type)
    new_e = Element(name='NewOther', element_type=string_type)

    assert e.similarity(new_e) == 0.6666666666666666
示例#2
0
def test_element_similarity_with_equal_elements_must_return_as_expected(
        string_type):
    e = Element(name='Name', element_type=string_type)
    new_e = Element(name='Name', element_type=string_type)

    assert e.similarity(new_e) == 1.0