コード例 #1
0
def test_city_desc():
    response = get_city_description("New York", "United States")
    assert((response['url'] != None and response['title'] != None and \
           response['text'] != None) == True) # test_city_desc test #1
    response = get_city_description("Paris", "France")
    assert((response['url'] != None and response['title'] != None and \
           response['text'] != None) == True) # test_city_desc test #1
コード例 #2
0
ファイル: tests_wip.py プロジェクト: cdxr/CitySketch
def test_city_desc():
    response = get_city_description("New York", "United States")
    assert (
        response["url"] != None and response["title"] != None and response["text"] != None
    ) == True  # test_city_desc test #1
    response = get_city_description("Paris", "France")
    assert (
        response["url"] != None and response["title"] != None and response["text"] != None
    ) == True  # test_city_desc test #1
コード例 #3
0
ファイル: index.py プロジェクト: cdxr/CitySketch
def city_description():
    city_name = request.args.get('city')
    country_name = request.args.get('country')
    response = city_desc.get_city_description(city_name, country_name)
    return json.dumps(response)
コード例 #4
0
ファイル: index.py プロジェクト: citysketch/citysketch_app
def city_description():
    city_name = request.args.get('city')
    country_name = request.args.get('country')
    response = city_desc.get_city_description(city_name, country_name) # generates the most accurate article
    return json.dumps(response)