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

ExceptionsTest.test_get_exitcode()   A

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
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