aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/misc/__init__.py0
-rw-r--r--test/misc/test_utils.py17
2 files changed, 17 insertions, 0 deletions
diff --git a/test/misc/__init__.py b/test/misc/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/misc/__init__.py
diff --git a/test/misc/test_utils.py b/test/misc/test_utils.py
new file mode 100644
index 0000000..72ce711
--- /dev/null
+++ b/test/misc/test_utils.py
@@ -0,0 +1,17 @@
+
+from pyecsca.misc.utils import TaskExecutor
+
+
+def run(a, b):
+ return a + b
+
+
+def test_executor():
+ with TaskExecutor(max_workers=2) as pool:
+ for i in range(10):
+ pool.submit_task(i,
+ run,
+ i, 5)
+ for i, future in pool.as_completed():
+ res = future.result()
+ assert res == i + 5