reorganize directory structure

This commit is contained in:
Roman Zeyde
2014-08-04 08:53:18 +03:00
parent b95f198877
commit 1139f56655
25 changed files with 15 additions and 24 deletions

15
amodem/test/test_ecc.py Normal file
View 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

View File

@@ -1,2 +0,0 @@
#!/bin/bash
(while [ true ]; do cat $1; done ) | aplay -q -f S16_LE -c 1 -r 32000

View File

@@ -1,22 +0,0 @@
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(16 * 1024))
y = ecc.encode(x)
x_ = concat(ecc.decode(y))
assert x_[:len(x)] == x
assert all(v == 0 for v in x_[len(x):])
def test_file():
data = open('data.send').read()
enc = ecc.encode(data)
assert concat(ecc.decode(enc)) == data