From 2aa097404a64260217bb06c131376c98adb8c980 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 14 Dec 2021 13:10:40 +0300 Subject: Provide expected values to use for tests --- tests/unit/db/test_datasets.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/db/test_datasets.py b/tests/unit/db/test_datasets.py index 39f4af9..0b8c2fe 100644 --- a/tests/unit/db/test_datasets.py +++ b/tests/unit/db/test_datasets.py @@ -13,15 +13,17 @@ class TestDatasetsDBFunctions(TestCase): def test_retrieve_dataset_name(self): """Test that the function is called correctly.""" - for trait_type, thresh, trait_name, dataset_name, columns, table in [ + for trait_type, thresh, trait_name, dataset_name, columns, table, expected in [ ["ProbeSet", 9, "probesetTraitName", "probesetDatasetName", - "Id, Name, FullName, ShortName, DataScale", "ProbeSetFreeze"], + "Id, Name, FullName, ShortName, DataScale", "ProbeSetFreeze", + {"dataset_id": None, "dataset_name": "probesetDatasetName", + "dataset_fullname": "probesetDatasetName"}], ["Geno", 3, "genoTraitName", "genoDatasetName", - "Id, Name, FullName, ShortName", "GenoFreeze"], + "Id, Name, FullName, ShortName", "GenoFreeze", {}], ["Publish", 6, "publishTraitName", "publishDatasetName", - "Id, Name, FullName, ShortName", "PublishFreeze"], + "Id, Name, FullName, ShortName", "PublishFreeze", {}], ["Temp", 4, "tempTraitName", "tempTraitName", - "Id, Name, FullName, ShortName", "TempFreeze"]]: + "Id, Name, FullName, ShortName", "TempFreeze", {}]]: db_mock = mock.MagicMock() with self.subTest(trait_type=trait_type): with db_mock.cursor() as cursor: @@ -29,7 +31,7 @@ class TestDatasetsDBFunctions(TestCase): self.assertEqual( retrieve_dataset_name( trait_type, thresh, trait_name, dataset_name, db_mock), - {}) + expected) cursor.execute.assert_called_once_with( "SELECT {cols} " "FROM {table} " -- cgit v1.2.3