def test_put_negative(self, client): for test in get_tests('api', 'put_negative_case'): response = client.put(test['url'], json=test['headers']) assert response.status_code == test['status']
def test_put_positive(self, client): for test in get_tests('api', 'put_positive_case'): response = client.put(test['url'], json=test['headers']) check_value = get_currency_value(test['headers']['currency']) assert response.status_code == 200 and check_value == test['value']
def test_get_negative(self, client): for url in get_tests('api', 'get_negative_case'): response = client.get(url) assert response.status_code == 404
def test_post_positive(self, client): for test in get_tests('api', 'post_positive_case'): response = client.post(test['url'], json=test['headers']) json_response = response.get_json() assert response.status_code == 200 and 'value' in json_response and \ json_response['value'] == test['value']
def test_get_positive(self, client): for url in get_tests('api', 'get_positive_case'): response = client.get(url) assert response.status_code == 200 and 'value' in response.get_json()