| Total Complexity | 1 |
| Total Lines | 12 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | """Test Python-openflow network types.""" |
||
| 14 | class TestIPV4(TestStructDump): |
||
| 15 | """Test the IPV4 class.""" |
||
| 16 | |||
| 17 | dump = b'F(\x00 \x00\x00\x00\x00@\x11\x02' +\ |
||
| 18 | b'\xc5\xc0\xa8\x00\n\xac\x10\n\x1e1000testdata' |
||
| 19 | obj = IPv4(dscp=10, ttl=64, protocol=17, source="192.168.0.10", |
||
| 20 | destination="172.16.10.30", options=b'1000', |
||
| 21 | data=b'testdata') |
||
| 22 | |||
| 23 | def test_IPv4_checksum(self): |
||
| 24 | """Test if the IPv4 checksum is being calculated correclty.""" |
||
| 25 | self.assertEqual(self._unpacked_dump.checksum, 709) |
||
| 26 |