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