mirror of
https://github.com/elliotnunn/macresources.git
synced 2024-06-07 05:29:30 +00:00
Add simple tests (run ./pytest).
This commit is contained in:
parent
ddfb909212
commit
c752c70c6a
13
test_everything.py
Normal file
13
test_everything.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from ResDecompress import GetEncoding, DecompressResource, CompressResource
|
||||
|
||||
def compress_then_extract(dat, encoding):
|
||||
a = CompressResource(dat, encoding);
|
||||
if encoding != 'UnknownCompression': assert a.startswith(b'\xA8\x9F\x65\x72')
|
||||
assert GetEncoding(a) == encoding
|
||||
b = DecompressResource(a)
|
||||
assert b == dat
|
||||
|
||||
def test_all():
|
||||
for enc in ['GreggyBits', 'UnknownCompression']:
|
||||
compress_then_extract(bytes(100), encoding=enc)
|
||||
compress_then_extract(b'The quick brown fox jumps over the lazy dog', encoding=enc)
|
Loading…
Reference in New Issue
Block a user