aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sca
diff options
context:
space:
mode:
authorJ08nY2020-03-03 13:32:14 +0100
committerJ08nY2020-03-03 13:32:14 +0100
commit9ed79b918009580a04649c7acdce63247d2314ed (patch)
tree1f26c579818583cbdc763ee8aa6b7da33d3e8921 /test/sca
parentc5d813d80c5314b3609ee88a21bac625a9ae5d60 (diff)
downloadpyecsca-9ed79b918009580a04649c7acdce63247d2314ed.tar.gz
pyecsca-9ed79b918009580a04649c7acdce63247d2314ed.tar.zst
pyecsca-9ed79b918009580a04649c7acdce63247d2314ed.zip
Add support for getting neutral points in coordinate systems.
Diffstat (limited to 'test/sca')
-rw-r--r--test/sca/test_target.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/sca/test_target.py b/test/sca/test_target.py
new file mode 100644
index 0000000..25d506a
--- /dev/null
+++ b/test/sca/test_target.py
@@ -0,0 +1,20 @@
+from unittest import TestCase
+from os.path import realpath, dirname, join
+
+
+from pyecsca.sca.target import BinaryTarget, SimpleSerialTarget, SimpleSerialMessage
+
+class TestTarget(SimpleSerialTarget, BinaryTarget):
+ pass
+
+class BinaryTargetTests(TestCase):
+
+ def test_basic_target(self):
+ target_path = join(dirname(realpath(__file__)), "..", "data", "target.py")
+ target = TestTarget(["python", target_path])
+ target.connect()
+ resp = target.send_cmd(SimpleSerialMessage("d", ""), 500)
+ self.assertIn("r", resp)
+ self.assertIn("z", resp)
+ self.assertEqual(resp["r"].data, "01020304")
+ target.disconnect() \ No newline at end of file