From 2664095e21841b4577f115db61988a90a9d1ed60 Mon Sep 17 00:00:00 2001 From: manmorjim Date: Mon, 2 Mar 2020 15:26:59 +0100 Subject: [PATCH] Update tolerance and fixture values --- test/helpers/integration_test_helper.py | 8 ++++---- test/integration/test_street_functions.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/helpers/integration_test_helper.py b/test/helpers/integration_test_helper.py index 76ffcd8..4d07382 100644 --- a/test/helpers/integration_test_helper.py +++ b/test/helpers/integration_test_helper.py @@ -10,7 +10,7 @@ def isclose(a, b, rel_tol=1e-09, abs_tol=0.0): return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) -def assert_close_enough(xy_a, xy_b, rel_tol=0.0001, abs_tol=0.0005): +def assert_close_enough(xy_a, xy_b, rel_tol=0.001, abs_tol=0.0005): """ Asserts that the given points are "close enough", in a square. :param xy_a: Array of 2 elements, X and Y. @@ -23,7 +23,7 @@ def assert_close_enough(xy_a, xy_b, rel_tol=0.0001, abs_tol=0.0005): assert_true(isclose(xy_a[i], xy_b[i], rel_tol, abs_tol), "Coord {} error: {} and {} are not closer than {}, {}".format( i, xy_a[i], xy_b[i], rel_tol, abs_tol - )) + )) class IntegrationTestHelper: @@ -48,8 +48,8 @@ class IntegrationTestHelper: def execute_query_raw(cls, sql_api_url, query, method='GET'): requests.packages.urllib3.disable_warnings() if method.upper() == 'GET': - query_url = "{0}?q={1}".format(sql_api_url, query) - query_response = requests.get(query_url) + query_url = "{0}?q={1}".format(sql_api_url, query) + query_response = requests.get(query_url) print("Executing query GET: {0}".format(query_url)) else: query_response = requests.post(sql_api_url, data={"q": query}) diff --git a/test/integration/test_street_functions.py b/test/integration/test_street_functions.py index 8ddbce6..9d8a7f9 100644 --- a/test/integration/test_street_functions.py +++ b/test/integration/test_street_functions.py @@ -85,9 +85,9 @@ class TestStreetFunctionsSetUp(TestCase): TOMTOM_METADATAS = { 'Plaza España, Barcelona': - {'relevance': 0.85, 'precision': 'precise', 'match_types': ['street']}, + {'relevance': 0.72, 'precision': 'precise', 'match_types': ['street']}, 'Santiago Rusiñol 123, Valladolid': - {'relevance': 0.45, 'precision': 'interpolated', 'match_types': ['street']} + {'relevance': 0.74, 'precision': 'precise', 'match_types': ['street']} } MAPBOX_METADATAS = {