Esempio n. 1
0
 def test_get_wrong_parameter_from_yaml(self):
     with open(self._foo_path) as f:
         model = json.dumps(yaml.safe_load(f))
     with self.assertRaises(ValidationError):
         tosca_file_handler.get_parameter_from_yaml("wrong_parameter",
                                                    model)
Esempio n. 2
0
 def test_get_parameter_from_wrong_yaml(self):
     with self.assertRaises(FileNotFoundError):
         with open("wrong_path") as f:
             model = json.dumps(yaml.safe_load(f))
             tosca_file_handler.get_parameter_from_yaml("metadata", model)
Esempio n. 3
0
 def test_get_parameter_from_yaml(self):
     with open(self._foo_path) as f:
         model = json.dumps(yaml.safe_load(f))
     param = tosca_file_handler.get_parameter_from_yaml("metadata", model)
     self.assertEqual(param['name'], "ubuntu16")