-
Notifications
You must be signed in to change notification settings - Fork 0
Stage to Prod #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Stage to Prod #41
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9342f2f
Fixed task-1467
sujata-m e98640a
Fixed task-1467
sujata-m c2584aa
Removed unnecessary files
sujata-m 631fe22
Updated package
sujata-m bd83973
Merge pull request #37 from TaskarCenterAtUW/feature-1467
sujata-m cc354bd
Merge pull request #38 from TaskarCenterAtUW/dev
sujata-m cf408b4
Fixed Task 1564 and 1566
sujata-m 0c40816
Merge pull request #39 from TaskarCenterAtUW/feature-1564
sujata-m b8cc18d
Merge branch 'stage' into dev
sujata-m b5213b3
Merge pull request #40 from TaskarCenterAtUW/dev
sujata-m e3685a4
Merge branch 'main' into stage
sujata-m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| fastapi==0.88.0 | ||
| pydantic==1.10.4 | ||
| python-ms-core==0.0.22 | ||
| python-ms-core==0.0.23 | ||
| uvicorn==0.20.0 | ||
| html_testRunner==1.2.1 | ||
| geopandas==0.14.4 | ||
| python-osw-validation==0.2.7 | ||
| python-osw-validation==0.2.9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import unittest | ||
| from abc import ABC | ||
| from unittest.mock import MagicMock | ||
| from python_ms_core.core.queue.models.queue_message import QueueMessage | ||
| from src.interface.validator_abstract import ValidatorAbstract | ||
|
|
||
|
|
||
| # A concrete implementation of ValidatorAbstract for testing | ||
| class ConcreteValidator(ValidatorAbstract): | ||
| def validate(self, message: QueueMessage) -> None: | ||
| # Example implementation: Simply pass for testing purposes | ||
| pass | ||
|
|
||
|
|
||
| class TestValidatorAbstract(unittest.TestCase): | ||
|
|
||
| def test_abstract_method_enforcement(self): | ||
| # Ensure that ValidatorAbstract cannot be instantiated directly | ||
| with self.assertRaises(TypeError): | ||
| ValidatorAbstract() | ||
|
|
||
| def test_concrete_validator_instance(self): | ||
| # Ensure a concrete class can be instantiated and implements `validate` | ||
| validator = ConcreteValidator() | ||
| self.assertIsInstance(validator, ValidatorAbstract) | ||
|
|
||
| def test_validate_method_called(self): | ||
| # Mock a QueueMessage object | ||
| message = MagicMock(spec=QueueMessage) | ||
|
|
||
| # Create an instance of the concrete validator | ||
| validator = ConcreteValidator() | ||
|
|
||
| # Call the validate method and ensure it executes without error | ||
| validator.validate(message) | ||
|
|
||
| # Assert that the mocked message object is a valid argument | ||
| self.assertTrue(hasattr(message, '__class__')) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| unittest.main() |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import os | ||
| import unittest | ||
| from unittest.mock import patch | ||
| from src.config import Settings | ||
|
|
||
|
|
||
| class TestSettings(unittest.TestCase): | ||
|
|
||
| @patch.dict(os.environ, { | ||
| 'AUTH_PERMISSION_URL': 'http://auth-url.com', | ||
| 'MAX_CONCURRENT_MESSAGES': '5', | ||
| 'AUTH_SIMULATE': 'True' | ||
| }, clear=True) | ||
| def test_settings_with_simulated_auth(self): | ||
| settings = Settings() | ||
| self.assertEqual(settings.app_name, 'python-osw-validation') | ||
| self.assertEqual(settings.auth_permission_url, 'http://auth-url.com') | ||
| self.assertEqual(settings.max_concurrent_messages, 5) | ||
| self.assertEqual(settings.auth_provider, 'Simulated') | ||
|
|
||
| @patch.dict(os.environ, { | ||
| 'AUTH_PERMISSION_URL': 'http://auth-url.com', | ||
| 'MAX_CONCURRENT_MESSAGES': '10', | ||
| 'AUTH_SIMULATE': 'False' | ||
| }, clear=True) | ||
| def test_settings_with_hosted_auth(self): | ||
| settings = Settings() | ||
| self.assertEqual(settings.auth_provider, 'Hosted') | ||
|
|
||
| @patch.dict(os.environ, { | ||
| 'AUTH_SIMULATE': 'invalid_value' | ||
| }, clear=True) | ||
| def test_settings_with_invalid_auth_simulate(self): | ||
| settings = Settings() | ||
| self.assertEqual(settings.auth_provider, 'Hosted') | ||
|
|
||
| @patch.dict(os.environ, {}, clear=True) | ||
| def test_default_settings(self): | ||
| settings = Settings() | ||
| self.assertEqual(settings.app_name, 'python-osw-validation') | ||
| self.assertEqual(settings.event_bus.container_name, 'osw') | ||
| self.assertIsNone(settings.auth_permission_url) | ||
| self.assertEqual(settings.max_concurrent_messages, 2) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| unittest.main() |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium