mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
...
This commit is contained in:
parent
60e666c12e
commit
e9b4734004
2
.gitignore
vendored
2
.gitignore
vendored
@ -36,3 +36,5 @@ pypi/
|
|||||||
libpocketpy.dylib
|
libpocketpy.dylib
|
||||||
|
|
||||||
.xmake/
|
.xmake/
|
||||||
|
tests/res/WorldMap_Free_layout.ldtk
|
||||||
|
tests/res/WorldMap_GridVania_layout.ldtk
|
||||||
|
21
tests/82_ldtk.py
Normal file
21
tests/82_ldtk.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
|
_2489KB = 'WorldMap_GridVania_layout.ldtk'
|
||||||
|
_1093KB = 'WorldMap_Free_layout.ldtk'
|
||||||
|
_339KB = 'Typical_2D_platformer_example.ldtk'
|
||||||
|
|
||||||
|
with open(f'res/{_339KB}', 'r') as f:
|
||||||
|
json_content = f.read()
|
||||||
|
|
||||||
|
data: dict = json.loads(json_content)
|
||||||
|
assert isinstance(data, dict)
|
||||||
|
|
||||||
|
dumped: str = json.dumps(data)
|
||||||
|
loaded: dict = json.loads(dumped)
|
||||||
|
assert data == loaded
|
||||||
|
|
||||||
|
# import pickle
|
||||||
|
##### very very slow!! DO NOT RUN IT
|
||||||
|
# data_pickled: bytes = pickle.dumps(data)
|
||||||
|
# assert isinstance(data_pickled, bytes)
|
||||||
|
# assert pickle.loads(data_pickled) == data
|
5553
tests/res/Typical_2D_platformer_example.ldtk
Normal file
5553
tests/res/Typical_2D_platformer_example.ldtk
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user