Failed Conditions
Pull Request — master (#2076)
by Abdeali
02:11
created

ExceptionsTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 10
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):
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable unittest does not seem to be defined.
Loading history...
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