From fdac834c57f751e0c355c25741208b9fc9ee3372 Mon Sep 17 00:00:00 2001 From: Sandro Loch Date: Tue, 5 Dec 2023 11:13:02 -0300 Subject: [PATCH] fix: Set sorted list for 'supported_databases' --- .github/workflows/python-package.yml | 4 ---- pysus/online_data/__init__.py | 6 +++--- pysus/tests/test_init.py | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 941674d..3b4ab88 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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 diff --git a/pysus/online_data/__init__.py b/pysus/online_data/__init__.py index 00a50db..ce77259 100644 --- a/pysus/online_data/__init__.py +++ b/pysus/online_data/__init__.py @@ -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", @@ -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)}""" diff --git a/pysus/tests/test_init.py b/pysus/tests/test_init.py index 0cea89e..d57df18 100644 --- a/pysus/tests/test_init.py +++ b/pysus/tests/test_init.py @@ -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)