示例#1
0
def test_get_zip_error_country():
    address = "1776 Fourth Avenue, St. Catharines, Ontario L2R 6P9"
    country = "IN"
    with pytest.raises(ValueError):
        get_zip(address, country=country)
示例#2
0
def test_get_zip_with_country_ca():
    address = "1776 Fourth Avenue, St. Catharines, Ontario L2R 6P9"
    assert get_zip(address, country='CA') == "L2R 6P9"
示例#3
0
def test_get_zip_no_zip():
    assert get_zip("San Diego, CA") is None
示例#4
0
def test_get_zip_none_gets_none():
    assert get_zip(None) is None
示例#5
0
def test_get_zip():
    assert get_zip("San Diego, CA 92129") == "92129"