mirror of
https://github.com/romanz/amodem.git
synced 2026-04-17 03:36:00 +08:00
tests: move to root directory
This commit is contained in:
15
tests/test_ecc.py
Normal file
15
tests/test_ecc.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import ecc
|
||||
import random
|
||||
import itertools
|
||||
|
||||
|
||||
def concat(chunks):
|
||||
return bytearray(itertools.chain.from_iterable(chunks))
|
||||
|
||||
|
||||
def test_random():
|
||||
r = random.Random(0)
|
||||
x = bytearray(r.randrange(0, 256) for i in range(64 * 1024))
|
||||
y = ecc.encode(x)
|
||||
x_ = concat(ecc.decode(y))
|
||||
assert x_ == x
|
||||
Reference in New Issue
Block a user