TestHost.test_as_dict()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 1
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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