Skip to content

Commit f49f5f5

Browse files
authored
Merge pull request #63 from TaskarCenterAtUW/bugfix-2737
BUGFIX-2737
2 parents 33b00c6 + c5af4ce commit f49f5f5

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ python-ms-core==0.0.23
44
uvicorn==0.20.0
55
html_testRunner==1.2.1
66
geopandas==0.14.4
7-
python-osw-validation==0.3.0
7+
python-osw-validation==0.3.1

tests/unit_tests/test_config.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import unittest
33
from unittest.mock import patch
44
from src.config import Settings
5+
import importlib
56

67

78
class TestSettings(unittest.TestCase):
@@ -34,9 +35,12 @@ def test_settings_with_invalid_auth_simulate(self):
3435
settings = Settings()
3536
self.assertEqual(settings.auth_provider, 'Hosted')
3637

37-
@patch.dict(os.environ, {}, clear=True)
38+
@patch.dict(os.environ, {'CONTAINER_NAME': 'osw'}, clear=True)
3839
def test_default_settings(self):
39-
settings = Settings()
40+
# Reload config to pick up the patched environment and bypass .env values
41+
from src import config
42+
importlib.reload(config)
43+
settings = config.Settings()
4044
self.assertEqual(settings.app_name, 'python-osw-validation')
4145
self.assertEqual(settings.event_bus.container_name, 'osw')
4246
self.assertIsNone(settings.auth_permission_url)

tests/unit_tests/test_validation.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,23 @@ def test_validate_invalid_file_with_errors(self, mock_download_file, mock_clean_
9292
expected_errors = [
9393
{
9494
'feature_index': 3,
95-
'error_message': '"highway" is a required property'
95+
'error_message': "Additional properties are not allowed ('crossing' was unexpected)"
9696
},
9797
{
9898
'feature_index': 6,
99-
'error_message': '"highway" is a required property'
99+
'error_message': "Additional properties are not allowed ('crossing' was unexpected)"
100100
},
101101
{
102102
'feature_index': 8,
103-
'error_message': '"highway" is a required property'
103+
'error_message': "Additional properties are not allowed ('crossing' was unexpected)"
104104
},
105105
{
106106
'feature_index': 25,
107107
'error_message': "Additional properties are not allowed ('crossing' was unexpected)"
108+
},
109+
{
110+
'feature_index': 27,
111+
'error_message': "Additional properties are not allowed ('crossing' was unexpected)"
108112
}
109113
]
110114
# Act

0 commit comments

Comments
 (0)