From 4fef77c91b254d6faf10d255059e06d2cab3d22f Mon Sep 17 00:00:00 2001 From: Atalya Alon Date: Wed, 29 May 2024 21:06:24 +0300 Subject: [PATCH] add location accuracy = 3 in SubUrban roads --- anyway/backend_constants.py | 4 ++-- tests/test_infographic_api.py | 2 +- tests/test_infographics_utils.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/anyway/backend_constants.py b/anyway/backend_constants.py index 3c4b713d..e3b2abd1 100644 --- a/anyway/backend_constants.py +++ b/anyway/backend_constants.py @@ -82,8 +82,8 @@ class ResolutionCategories(Enum): ] RESOLUTION_ACCURACY_VALUES: dict = { - ResolutionCategories.SUBURBAN_JUNCTION: [1, 4], - ResolutionCategories.SUBURBAN_ROAD: [1, 4], + ResolutionCategories.SUBURBAN_JUNCTION: [1, 3, 4], + ResolutionCategories.SUBURBAN_ROAD: [1, 3, 4], ResolutionCategories.URBAN_JUNCTION: [1, 3], ResolutionCategories.STREET: [1, 3], } diff --git a/tests/test_infographic_api.py b/tests/test_infographic_api.py index 05e5d165..664753d0 100644 --- a/tests/test_infographic_api.py +++ b/tests/test_infographic_api.py @@ -270,7 +270,7 @@ def test_fatal_yoy_monthly(self): "type": "object", "properties": {"label_key": {"type": "number"}, "value": {"type": "number"}, }, } - assert widget["data"]["items"][0] == {'label_key': 2014, 'value': 24} + assert widget["data"]["items"][0] == {'label_key': 2014, 'value': 29} validate(widget["data"]["items"][0], schema) assert widget["data"]["text"]["title"] == "כמות ההרוגים בתאונות דרכים בחודש הנוכחי בהשוואה לשנים קודמות" diff --git a/tests/test_infographics_utils.py b/tests/test_infographics_utils.py index 371828a9..6e20a5a0 100644 --- a/tests/test_infographics_utils.py +++ b/tests/test_infographics_utils.py @@ -129,12 +129,12 @@ def test_add_resolution_location_accuracy_filter(self): actual = add_resolution_location_accuracy_filter(None, RC.STREET) self.assertEqual({'location_accuracy': [1, 3]}, actual, "3") actual = add_resolution_location_accuracy_filter(f, RC.SUBURBAN_JUNCTION) - self.assertEqual({'1': 1, 'location_accuracy': [1, 4]}, actual, "4") + self.assertEqual({'1': 1, 'location_accuracy': [1, 3, 4]}, actual, "4") actual = add_resolution_location_accuracy_filter(None, RC.SUBURBAN_ROAD) - self.assertEqual({'location_accuracy': [1, 4]}, actual, "5" + self.assertEqual({'location_accuracy': [1, 3, 4]}, actual, "5" ) actual = add_resolution_location_accuracy_filter(f, RC.SUBURBAN_JUNCTION) - self.assertEqual({'1': 1, 'location_accuracy': [1, 4]}, actual, "6",) + self.assertEqual({'1': 1, 'location_accuracy': [1, 3, 4]}, actual, "6",) actual = add_resolution_location_accuracy_filter(None, RC.STREET) self.assertEqual({'location_accuracy': [1, 3]}, actual, "7") actual = add_resolution_location_accuracy_filter(f, RC.OTHER)