File: test_exception.py

package info (click to toggle)
odil 0.13.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,476 kB
  • sloc: cpp: 55,982; python: 3,947; javascript: 460; xml: 182; makefile: 99; sh: 36
file content (25 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import unittest

import odil

class TestException(unittest.TestCase):
    def test_python_generic(self):
        with self.assertRaises(Exception):
            raise odil.Exception()
    
    def test_python_specific(self):
        with self.assertRaises(odil.Exception):
            raise odil.Exception()

    def test_cpp_generic(self):
        tag = odil.Tag(0xdead, 0xbeef)
        with self.assertRaises(Exception):
            tag.get_name()
    
    def test_cpp_specific(self):
        tag = odil.Tag(0xdead, 0xbeef)
        with self.assertRaises(odil.Exception):
            tag.get_name()

if __name__ == "__main__":
    unittest.main()