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

ProcessTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %
Metric Value
dl 0
loc 18
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 2 1
A test_sequentials() 0 7 1
A test_reverse_mapping() 0 5 1
1
import unittest
2
3
from coalib.misc.Enum import enum
4
5
6
class ProcessTest(unittest.TestCase):
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable unittest does not seem to be defined.
Loading history...
7
8
    def setUp(self):
9
        self.uut = enum("ZERO", "ONE", "TWO", THREE="val")
10
11
    def test_sequentials(self):
12
        self.assertEqual(self.uut.ZERO, 0)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable self does not seem to be defined.
Loading history...
13
        self.assertEqual(self.uut.ONE, 1)
14
        self.assertEqual(self.uut.TWO, 2)
15
        self.assertEqual(self.uut.THREE, "val")
16
        self.assertEqual(self.uut.str_dict["ZERO"], 0)
17
        self.assertRaises(KeyError, self.uut.str_dict.__getitem__, "reverse")
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable KeyError does not seem to be defined.
Loading history...
18
19
    def test_reverse_mapping(self):
20
        self.assertEqual(self.uut.reverse[self.uut.ZERO], "ZERO")
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable self does not seem to be defined.
Loading history...
21
        self.assertEqual(self.uut.reverse[self.uut.ONE], "ONE")
22
        self.assertEqual(self.uut.reverse[self.uut.TWO], "TWO")
23
        self.assertEqual(self.uut.reverse[self.uut.THREE], "THREE")
24