From ec6a11b77636651a05762677f714aa0005a2033b Mon Sep 17 00:00:00 2001 From: Vahid Hashemian Date: Tue, 15 Sep 2015 14:47:59 -0700 Subject: [PATCH] Update links for URL referenced templates Update old links to github links (since now the new files reside on github). Also, update the assertions to verify that custom_defs is not an empty dict. Partially Implements: blueprint tosca-namespaces Change-Id: I12b63ff83e2e56ebe22ef58ca65a5bb5c222a4fb --- toscaparser/tests/test_toscatpl.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/toscaparser/tests/test_toscatpl.py b/toscaparser/tests/test_toscatpl.py index 6f12167..2a9018e 100644 --- a/toscaparser/tests/test_toscatpl.py +++ b/toscaparser/tests/test_toscatpl.py @@ -388,29 +388,34 @@ class ToscaTemplateTest(TestCase): os.path.dirname(os.path.abspath(__file__)), "data/tosca_single_instance_wordpress.yaml") tosca = ToscaTemplate(tosca_tpl) - self.assertIsNotNone(tosca.topology_template.custom_defs) + self.assertTrue(tosca.topology_template.custom_defs) def test_local_template_with_url_import(self): tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), "data/tosca_single_instance_wordpress_with_url_import.yaml") tosca = ToscaTemplate(tosca_tpl) - self.assertIsNotNone(tosca.topology_template.custom_defs) + self.assertTrue(tosca.topology_template.custom_defs) def test_url_template_with_local_relpath_import(self): tosca_tpl = ('https://raw.githubusercontent.com/openstack/' 'tosca-parser/master/toscaparser/tests/data/' 'tosca_single_instance_wordpress.yaml') tosca = ToscaTemplate(tosca_tpl, False) - self.assertIsNotNone(tosca.topology_template.custom_defs) + self.assertTrue(tosca.topology_template.custom_defs) def test_url_template_with_local_abspath_import(self): - tosca_tpl = ('http://tinyurl.com/nfbwjwd') + tosca_tpl = ('https://raw.githubusercontent.com/openstack/' + 'tosca-parser/master/toscaparser/tests/data/' + 'tosca_single_instance_wordpress_with_local_abspath_' + 'import.yaml') err = self.assertRaises(ImportError, ToscaTemplate, tosca_tpl, False) self.assertEqual('Absolute file name cannot be used for a URL-based ' 'input template.', err.__str__()) def test_url_template_with_url_import(self): - tosca_tpl = ('http://tinyurl.com/ow76273') + tosca_tpl = ('https://raw.githubusercontent.com/openstack/' + 'tosca-parser/master/toscaparser/tests/data/' + 'tosca_single_instance_wordpress_with_url_import.yaml') tosca = ToscaTemplate(tosca_tpl, False) - self.assertIsNotNone(tosca.topology_template.custom_defs) + self.assertTrue(tosca.topology_template.custom_defs)