aboutsummaryrefslogtreecommitdiff
path: root/test/sca/test_edit.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/sca/test_edit.py')
-rw-r--r--test/sca/test_edit.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/test/sca/test_edit.py b/test/sca/test_edit.py
index f701d83..282e62e 100644
--- a/test/sca/test_edit.py
+++ b/test/sca/test_edit.py
@@ -6,18 +6,21 @@ from pyecsca.sca import Trace, trim, reverse, pad
class EditTests(TestCase):
-
def setUp(self):
self._trace = Trace(np.array([10, 20, 30, 40, 50], dtype=np.dtype("i1")))
def test_trim(self):
result = trim(self._trace, 2)
self.assertIsNotNone(result)
- np.testing.assert_equal(result.samples, np.array([30, 40, 50], dtype=np.dtype("i1")))
+ np.testing.assert_equal(
+ result.samples, np.array([30, 40, 50], dtype=np.dtype("i1"))
+ )
result = trim(self._trace, end=3)
self.assertIsNotNone(result)
- np.testing.assert_equal(result.samples, np.array([10, 20, 30], dtype=np.dtype("i1")))
+ np.testing.assert_equal(
+ result.samples, np.array([10, 20, 30], dtype=np.dtype("i1"))
+ )
with self.assertRaises(ValueError):
trim(self._trace, 5, 1)
@@ -25,16 +28,21 @@ class EditTests(TestCase):
def test_reverse(self):
result = reverse(self._trace)
self.assertIsNotNone(result)
- np.testing.assert_equal(result.samples,
- np.array([50, 40, 30, 20, 10], dtype=np.dtype("i1")))
+ np.testing.assert_equal(
+ result.samples, np.array([50, 40, 30, 20, 10], dtype=np.dtype("i1"))
+ )
def test_pad(self):
result = pad(self._trace, 2)
self.assertIsNotNone(result)
- np.testing.assert_equal(result.samples,
- np.array([0, 0, 10, 20, 30, 40, 50, 0, 0], dtype=np.dtype("i1")))
+ np.testing.assert_equal(
+ result.samples,
+ np.array([0, 0, 10, 20, 30, 40, 50, 0, 0], dtype=np.dtype("i1")),
+ )
result = pad(self._trace, (1, 3))
self.assertIsNotNone(result)
- np.testing.assert_equal(result.samples,
- np.array([0, 10, 20, 30, 40, 50, 0, 0, 0], dtype=np.dtype("i1")))
+ np.testing.assert_equal(
+ result.samples,
+ np.array([0, 10, 20, 30, 40, 50, 0, 0, 0], dtype=np.dtype("i1")),
+ )