示例#1
0
def test_koeln():
    city_name, station_id, station_name, lang = getCityFromString("Köln")
    assert (city_name == "Köln" and lang == "de" and station_id == "4298")
    city = City(city_name, station_id, station_name, lang)
    img = city.defaultGraph()
    with open("tests/cologne.png", "wb") as f:
        f.write(img.read())
        f.close()
示例#2
0
def test_berlin():
    city_name, station_id, station_name, lang = getCityFromString("Berlin")
    assert (city_name == "Berlin" and lang == "de" and station_id == "4563")
    city = City(city_name, station_id, station_name, lang)
    img = city.defaultGraph()
    with open("tests/berlin.png", "wb") as f:
        f.write(img.read())
        f.close()
示例#3
0
def test_varsovie():
    city_name, station_id, station_name, lang = getCityFromString("Varsovie")
    assert (city_name == "Varsovie" and lang == "fr" and station_id == "209")
    city = City(city_name, station_id, station_name, lang)
    img = city.defaultGraph()
    with open("tests/varsovie.png", "wb") as f:
        f.write(img.read())
        f.close()
示例#4
0
def test_zarago():
    city_name, station_id, station_name, lang = getCityFromString(
        "Zaragoza please")
    assert (city_name == "Zaragoza" and lang == "en" and station_id == "238")
    city = City(city_name, station_id, station_name, lang)
    img = city.defaultGraph()
    with open("tests/zaragoza.png", "wb") as f:
        f.write(img.read())
        f.close()
示例#5
0
def test_plama():
    city_name, station_id, station_name, lang = getCityFromString(
        "Palma de mallorca bitte")
    assert (city_name == "Palma de Mallorca" and lang == "de"
            and station_id == "3918")
    city = City(city_name, station_id, station_name, lang)
    img = city.defaultGraph()
    with open("tests/parlma.png", "wb") as f:
        f.write(img.read())
        f.close()
示例#6
0
def test_citiesList():
    city = City("Paris", "11249", "ORLY", "fr")
    city.defaultGraph()
    assert ("température moyenne" in city.comment)