diff --git a/lower-constraints.txt b/lower-constraints.txt index 3eb9afd1..557a0899 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -7,7 +7,6 @@ cmd2==0.8.0 coverage==4.0 cryptography==2.7 debtcollector==1.2.0 -decorator==3.4.0 deprecation==1.0 docutils==0.11 dogpile.cache==0.6.2 @@ -53,7 +52,6 @@ python-mimeparse==1.6.0 python-novaclient==9.1.0 python-subunit==1.0.0 python-swiftclient==3.2.0 -pytz==2013.6 PyYAML==3.13 requests==2.18.0 requestsexceptions==1.2.0 diff --git a/translator/hot/tosca/tests/test_tosca_autoscaling.py b/translator/hot/tosca/tests/test_tosca_autoscaling.py index 2818d7b0..0e117ff7 100644 --- a/translator/hot/tosca/tests/test_tosca_autoscaling.py +++ b/translator/hot/tosca/tests/test_tosca_autoscaling.py @@ -43,15 +43,14 @@ class AutoscalingTest(TestCase): nodetemplate = NodeTemplate(name, nodetemplates) toscacompute = ToscaCompute(nodetemplate) toscacompute.handle_properties() - policy = Policy(policy_name, tpl, targets, - properties, "node_templates") + policy = Policy(policy_name, tpl, targets, properties, {}) toscascaling = ToscaAutoscaling( policy, hot_template_parameters=hot_template_parameters) parameters = toscascaling.handle_properties([toscacompute]) if hot_template_parameters: substack_template = toscascaling.extract_substack_templates( "output.yaml", HOT_TEMPLATE_VERSION) - actual_nested_resource = yaml.load( + actual_nested_resource = yaml.safe_load( substack_template['SP1_res.yaml']) self.assertEqual(expectedprops, actual_nested_resource) @@ -135,50 +134,32 @@ class AutoscalingTest(TestCase): default_instances: 1 ''' - expected_nested_resource = {'heat_template_version': - datetime.date(2013, 5, 23), - 'description': - 'Scaling template', - 'parameters': - {'flavor': - {'default': 'm1.tiny', - 'type': 'string', - 'description': - 'Flavor Information' - }, - 'image_name': - {'default': - 'cirros-0.3.5-x86_64-disk', - 'type': 'string', - 'description': 'Image Name' - } - }, - 'resources': - {'VDU1': - {'type': - 'OS::Nova::Server', - 'properties': - {'flavor': None, - 'user_data_format': - 'SOFTWARE_CONFIG' - } - } - } - } + expected = { + 'heat_template_version': datetime.date(2013, 5, 23), + 'description': 'Scaling template', + 'parameters': { + 'flavor': { + 'default': 'm1.tiny', + 'type': 'string', + 'description': 'Flavor Information'}, + 'image_name': { + 'default': 'cirros-0.3.5-x86_64-disk', + 'type': 'string', + 'description': 'Image Name'}}, + 'resources': { + 'VDU1': { + 'type': 'OS::Nova::Server', + 'properties': { + 'flavor': None, + 'user_data_format': 'SOFTWARE_CONFIG'}}}} - flavor = HotParameter('flavor', 'string', - label=None, + flavor = HotParameter('flavor', 'string', label=None, description='Flavor Information', default='m1.tiny', - hidden=None, - constraints=[]) - image = HotParameter('image_name', 'string', - label=None, + hidden=None, constraints=[]) + image = HotParameter('image_name', 'string', label=None, description='Image Name', default='cirros-0.3.5-x86_64-disk', - hidden=None, - constraints=[]) - hot_template_parameters = [flavor, image] - self._tosca_scaling_test(tpl_snippet, - expected_nested_resource, - hot_template_parameters) + hidden=None, constraints=[]) + hot_tpl_params = [flavor, image] + self._tosca_scaling_test(tpl_snippet, expected, hot_tpl_params)