From 2fabb2e70a95c2a628979353eac519540be88d73 Mon Sep 17 00:00:00 2001 From: Jordi Date: Mon, 27 May 2024 23:26:53 +0200 Subject: [PATCH] cosmetics --- tests/test_ncbiquery.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/test_ncbiquery.py b/tests/test_ncbiquery.py index bbe845658..f65be15e5 100644 --- a/tests/test_ncbiquery.py +++ b/tests/test_ncbiquery.py @@ -46,21 +46,23 @@ def execute_before_any_test(): def assert_homi_props(node): """Assert that node has the properties of Homininae.""" - p = node.props - assert p['sci_name'] == 'Homininae' - assert p['taxid'] == 207598 - assert p['rank'] == 'subfamily' - assert p['named_lineage'] == HUMAN_NAMED_LINEAGE[:-2] - assert p['lineage'] == HUMAN_LINEAGE[:-2] + expected = [('sci_name', 'Homininae'), + ('taxid', 207598), + ('rank', 'subfamily'), + ('named_lineage', HUMAN_NAMED_LINEAGE[:-2]), + ('lineage', HUMAN_LINEAGE[:-2])] + for prop, value in expected: + assert node.props[prop] == value def assert_human_props(node): """Assert that node has the properties of Homo sapiens.""" - p = node.props - assert p['sci_name'] == 'Homo sapiens' - assert p['taxid'] == 9606 - assert p['rank'] == 'species' - assert p['named_lineage'] == HUMAN_NAMED_LINEAGE - assert p['lineage'] == HUMAN_LINEAGE + expected = [('sci_name', 'Homo sapiens'), + ('taxid', 9606), + ('rank', 'species'), + ('named_lineage', HUMAN_NAMED_LINEAGE), + ('lineage', HUMAN_LINEAGE)] + for prop, value in expected: + assert node.props[prop] == value # The actual tests.