diff options
author | Alexanderlacuna | 2020-10-31 15:23:45 +0300 |
---|---|---|
committer | Alexanderlacuna | 2020-10-31 15:35:56 +0300 |
commit | 0b962eef391db6aae100a3283e89ee0ac0101f6b (patch) | |
tree | a3805c5d51dc2c79b80878df514505039f5a32b8 /wqflask/tests | |
parent | 544f24cb020136532689e3649be1902413f570c8 (diff) | |
download | genenetwork2-0b962eef391db6aae100a3283e89ee0ac0101f6b.tar.gz |
remove redundant classes
Diffstat (limited to 'wqflask/tests')
-rw-r--r-- | wqflask/tests/wqflask/show_trait/test_export_trait_data.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/wqflask/tests/wqflask/show_trait/test_export_trait_data.py b/wqflask/tests/wqflask/show_trait/test_export_trait_data.py index bd2f7dac..41761944 100644 --- a/wqflask/tests/wqflask/show_trait/test_export_trait_data.py +++ b/wqflask/tests/wqflask/show_trait/test_export_trait_data.py @@ -12,10 +12,6 @@ class AttributesSetter: setattr(self, key, value) -class HelperClass: - pass - - class TestExportTraits(unittest.TestCase): """Test methods related to converting dict to sortedlist""" @mock.patch("wqflask.show_trait.export_trait_data.create_trait") @@ -25,12 +21,11 @@ class TestExportTraits(unittest.TestCase): mock_dataset_attributes = AttributesSetter( {"type": "no_publish", "dataset_name": "Temp", "name": "Temp"}) - mock_nested_attributes = HelperClass() - mock_nested_attributes.name = "name" + mock_nested_attributes = AttributesSetter({"name": "name"}) mock_dataset_attributes.group = mock_nested_attributes mock_dataset.create_dataset.return_value = mock_dataset_attributes mock_trait.return_value = AttributesSetter({"symbol": "", "description_display": "Description", - "title": "research1", "journal": "", "authors": ""}) + "title": "research1", "journal": "", "authors": ""}) results = get_export_metadata("random_id", "Temp") expected = [["Record ID: random_id"], @@ -48,14 +43,13 @@ class TestExportTraits(unittest.TestCase): def test_get_export_metadata_with_publish(self, data_mock, trait_mock): """test for exporting metadata with dataset.type=Publish""" mock_dataset_attributes = AttributesSetter({"type": "Publish", "dataset_name": "Temp", - "name": "Temp", "description_display": "Description goes here"}) + "name": "Temp", "description_display": "Description goes here"}) - mock_nested_attributes = HelperClass() - mock_nested_attributes.name = "name" + mock_nested_attributes = AttributesSetter({"name": "name"}) mock_dataset_attributes.group = mock_nested_attributes data_mock.create_dataset.return_value = mock_dataset_attributes trait_instance = AttributesSetter({"symbol": "", "description_display": "Description", - "title": "research1", "journal": "", "authors": ""}) + "title": "research1", "journal": "", "authors": ""}) trait_mock.return_value = trait_instance results = get_export_metadata( |