diff --git a/tests/test_common.py b/tests/test_common.py index fe174a2..28e5572 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -55,6 +55,7 @@ def test_saturation(): except common.SaturationError as e: assert e.args == (max(x),) + def test_izip(): x = range(10) y = range(-10, 0) diff --git a/tests/test_equalizer.py b/tests/test_equalizer.py index d62a22b..9e31315 100644 --- a/tests/test_equalizer.py +++ b/tests/test_equalizer.py @@ -7,6 +7,7 @@ from amodem import equalizer from amodem import config config = config.fastest() + def assert_approx(x, y, e=1e-12): assert norm(x - y) < e * norm(x) diff --git a/tests/test_framing.py b/tests/test_framing.py index 3a13074..04cdcdc 100644 --- a/tests/test_framing.py +++ b/tests/test_framing.py @@ -34,16 +34,17 @@ def test_main(data): decoded = framing.decode(encoded) assert bytearray(decoded) == data + def test_fail(): encoded = list(framing.encode('')) encoded[-1] = not encoded[-1] with pytest.raises(ValueError): list(framing.decode(encoded)) + def test_missing(): f = framing.Framer() with pytest.raises(ValueError): list(f.decode(b'\x00')) with pytest.raises(ValueError): list(f.decode(b'\x01\x02\x03\x04')) -