Skip to content

Commit

Permalink
fix: Set sorted list for 'supported_databases'
Browse files Browse the repository at this point in the history
  • Loading branch information
esloch committed Dec 5, 2023
1 parent 664828b commit fdac834
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ jobs:
run: |
make run-jupyter-pysus
- name: Test unnittest
run: |
pytest -vv pysus/tests/test_init.py
- name: Test with pytest
run: |
make conda-install-geo
Expand Down
6 changes: 3 additions & 3 deletions pysus/online_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ def list_data_sources() -> str:
for file in databases_directory.glob("*.py")
if file.name != "__init__.py"
]
# breakpoint()

return f"""Currently, the supported databases are: {
', '.join(supported_databases)}"""
', '.join(sorted(supported_databases))}"""
else:
expected_databases = [
"SINAN",
Expand All @@ -174,7 +174,7 @@ def list_data_sources() -> str:
"CNES",
"CIHA",
]
# breakpoint()

return f"""No support for the databases was found."
"Expected databases for implementation are: {
', '.join(expected_databases)}"""
Expand Down
2 changes: 1 addition & 1 deletion pysus/tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_last_update(self):
class TestListDataSources(unittest.TestCase):
@patch("pysus.online_data.Path.exists")
def test_list_data_sources_exists(self, mock_exists):
dbs = "SIM, SIA, SINAN, SINASC, SIH, CNES"
dbs = "CNES, SIA, SIH, SIM, SINAN, SINASC"
mock_exists.return_value = True
expected_output = f"""Currently, the supported databases are: {dbs}"""
self.assertEqual(online_data.list_data_sources(), expected_output)
Expand Down

0 comments on commit fdac834

Please sign in to comment.