File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import unittest
44
55from odml .tools import dict_parser
6- from odml .tools .parser_utils import ParserException
6+ from odml .tools .parser_utils import ParserException , InvalidVersionException
77
88
99class TestJSONParser (unittest .TestCase ):
@@ -40,12 +40,9 @@ def test_missing_version(self):
4040
4141 def test_invalid_version (self ):
4242 filename = "invalid_version.json"
43- message = "invalid odML document format version"
4443
4544 with open (os .path .join (self .basepath , filename )) as json_data :
4645 parsed_doc = json .load (json_data )
4746
48- with self .assertRaises (ParserException ) as exc :
47+ with self .assertRaises (InvalidVersionException ) :
4948 _ = self .json_reader .to_odml (parsed_doc )
50-
51- self .assertIn (message , str (exc .exception ))
Original file line number Diff line number Diff line change 22import unittest
33
44from odml .tools import xmlparser
5- from odml .tools .parser_utils import ParserException
5+ from odml .tools .parser_utils import ParserException , InvalidVersionException
66
77
88class TestXMLParser (unittest .TestCase ):
@@ -33,9 +33,6 @@ def test_missing_version(self):
3333
3434 def test_invalid_version (self ):
3535 filename = "invalid_version.xml"
36- message = "invalid odML document format version"
3736
38- with self .assertRaises (ParserException ) as exc :
37+ with self .assertRaises (InvalidVersionException ) :
3938 _ = self .xml_reader .from_file (os .path .join (self .basepath , filename ))
40-
41- self .assertIn (message , str (exc .exception ))
Original file line number Diff line number Diff line change 33import yaml
44
55from odml .tools import dict_parser
6- from odml .tools .parser_utils import ParserException
6+ from odml .tools .parser_utils import ParserException , InvalidVersionException
77
88
99class TestYAMLParser (unittest .TestCase ):
@@ -40,12 +40,9 @@ def test_missing_version(self):
4040
4141 def test_invalid_version (self ):
4242 filename = "invalid_version.yaml"
43- message = "invalid odML document format version"
4443
4544 with open (os .path .join (self .basepath , filename )) as raw_data :
4645 parsed_doc = yaml .load (raw_data )
4746
48- with self .assertRaises (ParserException ) as exc :
47+ with self .assertRaises (InvalidVersionException ) :
4948 _ = self .yaml_reader .to_odml (parsed_doc )
50-
51- self .assertIn (message , str (exc .exception ))
You can’t perform that action at this time.
0 commit comments