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)
def test_get_zip_with_country_ca(): address = "1776 Fourth Avenue, St. Catharines, Ontario L2R 6P9" assert get_zip(address, country='CA') == "L2R 6P9"
def test_get_zip_no_zip(): assert get_zip("San Diego, CA") is None
def test_get_zip_none_gets_none(): assert get_zip(None) is None
def test_get_zip(): assert get_zip("San Diego, CA 92129") == "92129"