Ejemplo n.º 1
0
def test_match_with_words_removed():
    same = 'no change'
    assert match_with_words_removed(same, same, ['test'])

    wd = 'norwich bus station'
    osm = 'norwich'
    assert match_with_words_removed(wd, osm, ['bus station'])
Ejemplo n.º 2
0
def test_match_with_words_removed():
    same = 'no change'
    assert match.match_with_words_removed(same, same, ['test'])
    assert not match.match_with_words_removed(same, same, [])

    wd = 'norwich bus station'
    osm = 'norwich'
    assert match.match_with_words_removed(osm, wd, ['bus station'])

    assert match.match_with_words_removed('Vif', 'gare de Vif', ['gare de'])
Ejemplo n.º 3
0
def test_name_match_trim_to_empty():
    osm = 'Hall'
    wd = 'Post Office'
    endings = ['hall', 'post office']

    assert not match.match_with_words_removed(osm.lower(), wd.lower(), endings)

    assert not match.name_match(osm, wd, endings=endings)
Ejemplo n.º 4
0
def test_match_with_words_removed_both():
    osm = 'Oxmoor Mall'.lower()
    wd = 'Oxmoor Center'.lower()
    endings = ['mall', 'center']
    m = match.match_with_words_removed(osm, wd, endings)
    assert m.match_type.name == 'both_trimmed'