ExceptionsTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_get_exitcode() 0 8 1
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