TestCallsProcessFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
dl 0
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_construct_process_not_ex() 0 5 2
A test_construct_process_linear() 0 5 1
1
"""Package to test calls_process_factory module."""
2
3
from unittest import TestCase
4
5
from grortir.main.model.processes.calls_process import CallsProcess
6
from grortir.main.model.processes.factories.calls_process_factory import \
7
    CallsProcessFactory
8
9
MAX_CALLS = 1000
10
11
12
class TestCallsProcessFactory(TestCase):
13
    """Class to test CallsProcessFactory."""
14
15
    def test_construct_process_linear(self):
16
        """Test linear process construction."""
17
        tested_object = CallsProcessFactory("linear", 7, MAX_CALLS)
18
        result = tested_object.construct_process()
19
        self.assertIsInstance(result, CallsProcess)
20
21
    def test_construct_process_not_ex(self):
22
        """Test case when structure not implemented."""
23
        tested_object = CallsProcessFactory("not_existed", 7, MAX_CALLS)
24
        with self.assertRaises(NotImplementedError):
25
            tested_object.construct_process()
26