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