Conditions | 1 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | """Testing Error Message.""" |
||
22 | def test_unpack_error_msg(self): |
||
23 | """Test Unpack a sample ErrorMsg.""" |
||
24 | expected = b'\x01\x01\x00\x1b\x00\x00\x00\x18\x00\x03\x00\x02FLOW' |
||
25 | |||
26 | error_msg = ErrorMsg(xid=24, |
||
27 | error_type=ErrorType.OFPET_FLOW_MOD_FAILED, |
||
28 | code=FlowModFailedCode.OFPFMFC_EPERM, |
||
29 | data=b'FLOW') |
||
30 | |||
31 | actual = ErrorMsg(xid=24) |
||
32 | actual.unpack(expected[8:]) |
||
33 | |||
34 | self.assertEqual(actual, error_msg) |
||
35 |