예제 #1
0
def test_google_query_response_no_result_candidates_key_candidates(
        mock_response_google_no_result):
    """ test google query response no result candidates key candidates """

    response = Query().query_google_place('aaaaaaaaaaaaaaaaaaaaaaaaa')
    assert 'candidates' in response.json()
예제 #2
0
def test_google_query_response_candidates_gt0(mock_response_google_positive):
    """ test google query response if candidates len > 0 """

    response = Query().query_google_place('openclassrooms')
    assert len(response.json()['candidates']) > 0
예제 #3
0
def test_google_query_response_key_status(mock_response_google_positive):
    """ test google query response if key 'status' """

    response = Query().query_google_place('openclassrooms')
    assert 'status' in response.json()
예제 #4
0
def test_google_query_response_key_status_ok(mock_response_google_positive):
    """ test google query response if key status is 'OK' """

    response = Query().query_google_place('openclassrooms')
    assert response.json()['status'] == 'OK'
예제 #5
0
def test_wikimedia_response_extract_is_not_none(
        mock_response_wikimedia_extracts):
    """ test wikimedia response extract is not none for '4338589' """

    response = Query().query_wikimedia_desciption('4338589')
    assert response.json() is not None