def _test_encode_header(self, user, on_wire): f = user n = ofp.oxm_from_user_header(f) buf = bytearray() ofp.oxm_serialize_header(n, buf, 0) self.assertEqual(on_wire, buf)