Passed
Push — master ( b28825...17b2dd )
by Dave
01:23
created

tests.test_bus   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A Test_bus.make_bus() 0 2 1
A Test_bus.test_bus_get_name_str() 0 3 1
A Test_bus.test_bus_get_name_q() 0 3 1
1
import unittest
2
from helpers.queuehelper import QueueName
3
from backend.fcmapp import InfrastructureService
4
from backend.fcmbus import Bus
5
6
class Test_bus(unittest.TestCase):
7
    def make_bus(self):
8
        return Bus(InfrastructureService('', '', '', '', '', ''))
9
10
    def test_bus_get_name_q(self):
11
        bus = self.make_bus()
12
        self.assertTrue(bus.get_queue_name(QueueName.Q_ALERT) == "alert")
13
14
    def test_bus_get_name_str(self):
15
        bus = self.make_bus()
16
        self.assertTrue(bus.get_queue_name("alert") == "alert")
17
18
if __name__ == '__main__':
19
    unittest.main()
20