X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/28ab2f6048eff33e6119271c9fd31852db64240a..baee6f3de09226c3dc41cb2314a0ac348e865561:/test/python/tokenizer/sanitizers/test_clean_postcodes.py diff --git a/test/python/tokenizer/sanitizers/test_clean_postcodes.py b/test/python/tokenizer/sanitizers/test_clean_postcodes.py index d6371e07..e5c07596 100644 --- a/test/python/tokenizer/sanitizers/test_clean_postcodes.py +++ b/test/python/tokenizer/sanitizers/test_clean_postcodes.py @@ -43,12 +43,14 @@ def test_postcode_no_country_drop(sanitize, country): assert sanitize(country=country, postcode='23231') == [] -@pytest.mark.parametrize("postcode", ('12345', ' 34009 ')) +@pytest.mark.parametrize("postcode", ('12345', ' 12345 ', 'de 12345', + 'DE12345', 'DE 12345', 'DE-12345')) def test_postcode_pass_good_format(sanitize, postcode): - assert sanitize(country='de', postcode=postcode) == [('postcode', postcode.strip())] + assert sanitize(country='de', postcode=postcode) == [('postcode', '12345')] -@pytest.mark.parametrize("postcode", ('123456', '', ' ', '.....')) +@pytest.mark.parametrize("postcode", ('123456', '', ' ', '.....', + 'DE 12345', 'DEF12345', 'CH 12345')) @pytest.mark.sanitizer_params(convert_to_address=False) def test_postcode_drop_bad_format(sanitize, postcode): assert sanitize(country='de', postcode=postcode) == []