build.tests.unit.test_model   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 21
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A TestHost.test_id() 0 4 1
A TestHost.test_as_dict() 0 5 1
1
"""Module to test model class."""
2
3 1
from napps.kytos.topology.models import Host
4
5
6 1
class TestHost:
7
    """Test the model class."""
8
9 1
    mac = "6e:c2:ea:c4:18:12"
10
11 1
    def test_as_dict(self):
12
        """Test as_dict."""
13 1
        host = Host(self.mac)
14 1
        expected = {'mac': self.mac, 'type': 'host'}
15 1
        assert host.as_dict() == expected
16
17 1
    def test_id(self):
18
        """Test id."""
19 1
        host = Host(self.mac)
20
        assert host.id == self.mac
21