Change test structs name to not get conflicts with pytest
parent
51746a71ac
commit
99c383d3c1
|
@ -759,37 +759,37 @@ Create a codec which will work for:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
class TestBytesClass(Struct, tag=True):
|
class BytesTestClass(Struct, tag=True):
|
||||||
raw: bytes
|
raw: bytes
|
||||||
|
|
||||||
def encode(self) -> bytes:
|
def encode(self) -> bytes:
|
||||||
return self.raw
|
return self.raw
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_bytes(self, raw: bytes) -> TestBytesClass:
|
def from_bytes(self, raw: bytes) -> BytesTestClass:
|
||||||
return TestBytesClass(raw=raw)
|
return BytesTestClass(raw=raw)
|
||||||
|
|
||||||
|
|
||||||
class TestStrClass(Struct, tag=True):
|
class StrTestClass(Struct, tag=True):
|
||||||
s: str
|
s: str
|
||||||
|
|
||||||
def encode(self) -> str:
|
def encode(self) -> str:
|
||||||
return self.s
|
return self.s
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_str(self, s: str) -> TestStrClass:
|
def from_str(self, s: str) -> StrTestClass:
|
||||||
return TestStrClass(s=s)
|
return StrTestClass(s=s)
|
||||||
|
|
||||||
|
|
||||||
class TestIntClass(Struct, tag=True):
|
class IntTestClass(Struct, tag=True):
|
||||||
num: int
|
num: int
|
||||||
|
|
||||||
def encode(self) -> int:
|
def encode(self) -> int:
|
||||||
return self.num
|
return self.num
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_int(self, num: int) -> TestIntClass:
|
def from_int(self, num: int) -> IntTestClass:
|
||||||
return TestIntClass(num=num)
|
return IntTestClass(num=num)
|
||||||
|
|
||||||
|
|
||||||
builtins = tuple((
|
builtins = tuple((
|
||||||
|
@ -798,7 +798,7 @@ builtins = tuple((
|
||||||
if builtin is not list
|
if builtin is not list
|
||||||
))
|
))
|
||||||
|
|
||||||
TestClasses = (TestBytesClass, TestStrClass, TestIntClass)
|
TestClasses = (BytesTestClass, StrTestClass, IntTestClass)
|
||||||
|
|
||||||
|
|
||||||
TestSpec = (
|
TestSpec = (
|
||||||
|
@ -846,13 +846,13 @@ def test_multi_custom_codec():
|
||||||
0xdeadbeef,
|
0xdeadbeef,
|
||||||
.42069,
|
.42069,
|
||||||
b'deadbeef',
|
b'deadbeef',
|
||||||
TestBytesClass(raw=b'deadbeef'),
|
BytesTestClass(raw=b'deadbeef'),
|
||||||
TestStrClass(s='deadbeef'),
|
StrTestClass(s='deadbeef'),
|
||||||
TestIntClass(num=0xdeadbeef),
|
IntTestClass(num=0xdeadbeef),
|
||||||
[
|
[
|
||||||
TestBytesClass(raw=b'deadbeef'),
|
BytesTestClass(raw=b'deadbeef'),
|
||||||
TestStrClass(s='deadbeef'),
|
StrTestClass(s='deadbeef'),
|
||||||
TestIntClass(num=0xdeadbeef),
|
IntTestClass(num=0xdeadbeef),
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue