From 2b3c3b045490d94d78c5f46d59ac72877ae6de3f Mon Sep 17 00:00:00 2001 From: spzala Date: Thu, 18 Dec 2014 23:48:33 -0800 Subject: [PATCH] Sort TOSCA relation output for a match to expected test result The TOSCA parser test test_template_requirements fails assertEqual due to an unsorted output list. Change-Id: Ife4e88a48a4b4336590d168682e6f75dd39d15bd Closes-Bug: #1404420 --- translator/toscalib/tests/test_toscatpl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translator/toscalib/tests/test_toscatpl.py b/translator/toscalib/tests/test_toscatpl.py index 489ddf62..0385d911 100644 --- a/translator/toscalib/tests/test_toscatpl.py +++ b/translator/toscalib/tests/test_toscatpl.py @@ -212,11 +212,11 @@ class ToscaTemplateTest(TestCase): for node_tpl in tosca.nodetemplates: if node_tpl.name == 'my_app': expected_relationship = [ - ('tosca.relationships.HostedOn', 'my_webserver'), - ('tosca.relationships.ConnectsTo', 'mysql_database')] - actual_relationship = [ + ('tosca.relationships.ConnectsTo', 'mysql_database'), + ('tosca.relationships.HostedOn', 'my_webserver')] + actual_relationship = sorted([ (relation.type, node.name) for - relation, node in node_tpl.relationship.items()] + relation, node in node_tpl.relationship.items()]) self.assertEqual(expected_relationship, actual_relationship) if node_tpl.name == 'mysql_database': self.assertEqual(