def forecast_txt(zip_code): station_zone = zip_codes.station_zone(zip_code) zone = station_zone[1] url = zip_codes.url(zone) page = request.urlopen(url) txt = [line.decode() for line in page] return txt
def test_url_mnz077(): assert z.url('mnz077') == 'http://weather.noaa.gov/pub/data/forecasts/zone/mn/mnz077.txt'
def test_url_caz547(): assert z.url('caz547') == 'http://weather.noaa.gov/pub/data/forecasts/zone/ca/caz547.txt'
def test_url_dcz001(): assert z.url('dcz001') == 'http://weather.noaa.gov/pub/data/forecasts/zone/dc/dcz001.txt'