Total Complexity | 2 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 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 |