build.tests.unit.test_model   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 22
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
from unittest import TestCase
3
4
from napps.kytos.topology.models import Host
5
6
7
class TestHost(TestCase):
8
    """Test the model class."""
9
10
    mac = "6e:c2:ea:c4:18:12"
11
12
    def test_as_dict(self):
13
        """Test as_dict."""
14
        host = Host(self.mac)
15
        expected = {'mac': self.mac, 'type': 'host'}
16
        self.assertEqual(host.as_dict(), expected)
17
18
    def test_id(self):
19
        """Test id."""
20
        host = Host(self.mac)
21
        self.assertEqual(host.id, self.mac)
22