mirror of
https://github.com/romanz/amodem.git
synced 2026-02-06 08:38:06 +08:00
PEP8 fixes for tests
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user