diff --git a/requirements.txt b/requirements.txt index 1b8bbdd..d6fb46f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ python-ms-core==0.0.23 uvicorn==0.20.0 html_testRunner==1.2.1 geopandas==0.14.4 -python-osw-validation==0.3.0 \ No newline at end of file +python-osw-validation==0.3.1 \ No newline at end of file diff --git a/tests/unit_tests/test_config.py b/tests/unit_tests/test_config.py index 886199f..65f9bd4 100644 --- a/tests/unit_tests/test_config.py +++ b/tests/unit_tests/test_config.py @@ -2,6 +2,7 @@ import unittest from unittest.mock import patch from src.config import Settings +import importlib class TestSettings(unittest.TestCase): @@ -34,9 +35,12 @@ def test_settings_with_invalid_auth_simulate(self): settings = Settings() self.assertEqual(settings.auth_provider, 'Hosted') - @patch.dict(os.environ, {}, clear=True) + @patch.dict(os.environ, {'CONTAINER_NAME': 'osw'}, clear=True) def test_default_settings(self): - settings = Settings() + # Reload config to pick up the patched environment and bypass .env values + from src import config + importlib.reload(config) + settings = config.Settings() self.assertEqual(settings.app_name, 'python-osw-validation') self.assertEqual(settings.event_bus.container_name, 'osw') self.assertIsNone(settings.auth_permission_url) diff --git a/tests/unit_tests/test_validation.py b/tests/unit_tests/test_validation.py index 7df6ac0..19f3099 100644 --- a/tests/unit_tests/test_validation.py +++ b/tests/unit_tests/test_validation.py @@ -92,19 +92,23 @@ def test_validate_invalid_file_with_errors(self, mock_download_file, mock_clean_ expected_errors = [ { 'feature_index': 3, - 'error_message': '"highway" is a required property' + 'error_message': "Additional properties are not allowed ('crossing' was unexpected)" }, { 'feature_index': 6, - 'error_message': '"highway" is a required property' + 'error_message': "Additional properties are not allowed ('crossing' was unexpected)" }, { 'feature_index': 8, - 'error_message': '"highway" is a required property' + 'error_message': "Additional properties are not allowed ('crossing' was unexpected)" }, { 'feature_index': 25, 'error_message': "Additional properties are not allowed ('crossing' was unexpected)" + }, + { + 'feature_index': 27, + 'error_message': "Additional properties are not allowed ('crossing' was unexpected)" } ] # Act