From d13069d7d9c1cd8feeb040a340715b672e495ec1 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sun, 24 Aug 2014 19:00:41 +0300 Subject: [PATCH] test saturation errors --- tests/test_common.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_common.py b/tests/test_common.py index cdcd791..0bf28ed 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -51,3 +51,12 @@ def test_dumps_loads(): x = np.array([.1, .4, .2, .6, .3, .5]) y = common.loads(common.dumps(x)) assert all(x == y) + + +def test_saturation(): + x = np.array([1, -1, 1, -1]) * 1.01 + try: + common.check_saturation(x) + assert False + except common.SaturationError as e: + assert e.args == (1.01,)