Ejemplo n.º 1
0
    def test_init_syntax_error(self):

        with self.assertRaisesRegexpression(SyntaxError, "Unknown tag: noCategory*"):
            sample_init = os.path.join(os.path.dirname(__file__), './parsing_error_1.xml')
            asterix.init(sample_init)

        with self.assertRaisesRegexpression(SyntaxError, "XMLParser : <Bits> without <Format>*"):
            sample_init = os.path.join(os.path.dirname(__file__), './parsing_error_2.xml')
            asterix.init(sample_init)
Ejemplo n.º 2
0
    def test_init_syntax_error(self):

        with self.assertRaisesRegexpression(SyntaxError,
                                            "Unknown tag: noCategory*"):
            sample_init = os.path.join(os.path.dirname(__file__),
                                       './parsing_error_1.xml')
            asterix.init(sample_init)

        with self.assertRaisesRegexpression(
                SyntaxError, "XMLParser : <Bits> without <Format>*"):
            sample_init = os.path.join(os.path.dirname(__file__),
                                       './parsing_error_2.xml')
            asterix.init(sample_init)
Ejemplo n.º 3
0
 def test_init_io_error(self):
     with self.assertRaises(IOError):
         asterix.init("unknown_file.xml")
Ejemplo n.º 4
0
 def test_init_value_error(self):
     with self.assertRaises(ValueError):
         asterix.init(0)
Ejemplo n.º 5
0
 def test_init_type_error(self):
     with self.assertRaises(TypeError):
         asterix.init()
Ejemplo n.º 6
0
 def test_init_ok(self):
     sample_init = os.path.join(os.path.dirname(__file__), '../config/asterix_cat062_1_16.xml')
     ret = asterix.init(sample_init)
     self.assertIs(ret, 0)
Ejemplo n.º 7
0
 def test_init_io_error(self):
     with self.assertRaises(IOError):
         asterix.init("unknown_file.xml")
Ejemplo n.º 8
0
 def test_init_value_error(self):
     with self.assertRaises(ValueError):
         asterix.init(0)
Ejemplo n.º 9
0
 def test_init_type_error(self):
     with self.assertRaises(TypeError):
         asterix.init()
Ejemplo n.º 10
0
 def test_init_ok(self):
     sample_init = os.path.join(os.path.dirname(__file__),
                                '../config/asterix_cat062_1_18.xml')
     ret = asterix.init(sample_init)
     self.assertIs(ret, 0)