Fix and test the validation of template file
The validation message is created without proper import. Add it with new test. Change-Id: Ia8a815e5f4b4c267e8a96faeebe8b5f9afe2b364 Partial-Bug: #1502937
This commit is contained in:
@@ -448,3 +448,11 @@ class ToscaTemplateTest(TestCase):
|
||||
'TestRsyslogType']
|
||||
self.assertItemsEqual(tosca.topology_template.custom_defs.keys(),
|
||||
expected_custom_types)
|
||||
|
||||
def test_invalid_template_file(self):
|
||||
template_file = 'invalid template file'
|
||||
expected_msg = ('%s is not a valid file.' % template_file)
|
||||
err = self.assertRaises(
|
||||
ValueError,
|
||||
lambda: ToscaTemplate(template_file, None, False))
|
||||
self.assertEqual(expected_msg, err.__str__())
|
||||
|
||||
@@ -21,6 +21,7 @@ import toscaparser.imports
|
||||
from toscaparser.prereq.csar import CSAR
|
||||
from toscaparser.topology_template import TopologyTemplate
|
||||
from toscaparser.tpl_relationship_graph import ToscaGraph
|
||||
from toscaparser.utils.gettextutils import _
|
||||
import toscaparser.utils.yamlparser
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user