structo 0.0.7__tar.gz → 0.0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {structo-0.0.7 → structo-0.0.8}/PKG-INFO +1 -1
- {structo-0.0.7 → structo-0.0.8}/structo/__init__.py +1 -1
- {structo-0.0.7 → structo-0.0.8}/structo/types/literal.py +1 -1
- structo-0.0.8/tests/test_literal.py +13 -0
- {structo-0.0.7 → structo-0.0.8}/.gitignore +0 -0
- {structo-0.0.7 → structo-0.0.8}/LICENSE +0 -0
- {structo-0.0.7 → structo-0.0.8}/README.md +0 -0
- {structo-0.0.7 → structo-0.0.8}/examples/custom_serializer.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/examples/iterable_serializer.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/examples/wav.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/pyproject.toml +0 -0
- {structo-0.0.7 → structo-0.0.8}/pytest.ini +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/object.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/packed.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/serialise.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/serializer.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/types/__init__.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/types/array.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/types/blob.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/types/buffer.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/types/list.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/types/object.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/types/packed.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/types/primatives.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/types/string.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/structo/utils.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/tests/test_array.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/tests/test_list.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/tests/test_object.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/tests/test_packed.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/tests/test_primatives.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/tests/test_size.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/tests/utils.py +0 -0
- {structo-0.0.7 → structo-0.0.8}/uv.lock +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from utils import test
|
|
2
|
+
import typing as t
|
|
3
|
+
|
|
4
|
+
import structo as st
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@test("Literal: reading basic")
|
|
8
|
+
def _():
|
|
9
|
+
class Foo(st.SerializableObject):
|
|
10
|
+
a: t.Annotated[bytes, st.Literal(b"a", b"b")]
|
|
11
|
+
|
|
12
|
+
obj = Foo(a=b"a")
|
|
13
|
+
assert obj == Foo.from_bytes(obj.to_bytes())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|