ExceptionsTest.test_get_exitcode()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
import unittest
2
3
from coalib.misc.Exceptions import get_exitcode
4
from pkg_resources import VersionConflict
5
6
7
class ExceptionsTest(unittest.TestCase):
8
9
    def test_get_exitcode(self):
10
        self.assertEqual(get_exitcode(KeyboardInterrupt()), 130)
11
        self.assertEqual(get_exitcode(AssertionError()), 255)
12
        self.assertEqual(get_exitcode(SystemExit(999)), 999)
13
        self.assertEqual(get_exitcode(VersionConflict(
14
            "libclang-py3 0.3", "libclang-py3==0.2")), 13)
15
        self.assertEqual(get_exitcode(EOFError()), 0)
16
        self.assertEqual(get_exitcode(None), 0)
17