You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deftest_pack_unpack(self):
@to_stringclassPoint(Struct):
""" Semantic eq method is provided by Struct @attr.define -- does not play well with the super-class @dataclass -- does not play well with the super-class """_endianess=Endianess.LittleEndianx=FieldType.WORDy=FieldType.WORDname=FieldType.String[6]("NONAME")
original_point=Point(x=1, y=2)
packed_point=original_point.pack()
assert_that(packed_point,
is_(b'\x01\x00\x02\x00NONAME'))
unpacked_point=Point.unpack(packed_point)
assert_that(unpacked_point,
is_(original_point))
self.log().debug(unpacked_point)
.0 = <list_iterator object at 0x7f04687c6c20>
attributes = [
attr
for attr in dir(self)
if not attr.startswith("_")
and not (
hasattr(self.__dict__[attr], "__call__")
if attr in self.__dict__
> else hasattr(decorated_class.__dict__[attr], "__call__")
)
]
E KeyError: 'pack'
tests/python/venv/lib/python3.10/site-packages/paprika/oo.py:21: KeyError
When I decorated my class with @to_string decorator, I got a KeyError. I found that there is a problem with the source code after I debugged.
After I print
dir(self)
andself.__dict__
, the attr ofdict(self)
are more thanself.__dict__
, thus result in theself.__dict__[attr]
KeyErrorThe text was updated successfully, but these errors were encountered: