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'])
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'])
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)
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'