Skip to content
Snippets Groups Projects
Commit 9f6816e3 authored by Pierre LALET's avatar Pierre LALET
Browse files

Fix test case (Packet attributes need to be in __slots__)

parent cb081c79
No related branches found
No related tags found
No related merge requests found
...@@ -218,15 +218,15 @@ assert(_ == '5\x00\x00\x14\x00\x01\x00\x00 \x00\xac\xe7\x7f\x00\x00\x01\x7f\x00\ ...@@ -218,15 +218,15 @@ assert(_ == '5\x00\x00\x14\x00\x01\x00\x00 \x00\xac\xe7\x7f\x00\x00\x01\x7f\x00\
~ field actionfield ~ field actionfield
class TestAction(Packet): class TestAction(Packet):
__slots__ = ["_val", "_fld", "_priv1", "_priv2"]
name = "TestAction" name = "TestAction"
fields_desc = [ ActionField(ByteField("tst", 3), "my_action", priv1=1, priv2=2) ] fields_desc = [ ActionField(ByteField("tst", 3), "my_action", priv1=1, priv2=2) ]
_val = None def __init__(self, *args, **kargs):
_fld = None self._val, self._fld, self._priv1, self._priv2 = None, None, None, None
_priv1 = None super(TestAction, self).__init__(*args, **kargs)
_priv2 = None
def my_action(self, val, fld, priv1, priv2): def my_action(self, val, fld, priv1, priv2):
print "Action (%i)!" %val print "Action (%i)!" %val
self._val, self._fld, self._priv1, self._priv2 = val, fld, priv1, priv2 self._val, self._fld, self._priv1, self._priv2 = val, fld, priv1, priv2
= Triggering action = Triggering action
~ field actionfield ~ field actionfield
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment