From b27254ba8039f7469ed5ac5be3292ca3a8a541cf Mon Sep 17 00:00:00 2001 From: Yann Sionneau Date: Wed, 3 Jun 2015 15:54:50 +0200 Subject: [PATCH] sync_struct test: test more cases, pep8 fix, remove print --- artiq/test/sync_struct.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/artiq/test/sync_struct.py b/artiq/test/sync_struct.py index d059727f4..a66185ce3 100644 --- a/artiq/test/sync_struct.py +++ b/artiq/test/sync_struct.py @@ -1,5 +1,6 @@ import unittest import asyncio +import numpy as np from artiq.protocols import sync_struct @@ -9,8 +10,14 @@ test_port = 7777 @asyncio.coroutine def write_test_data(test_dict): + test_values = [5, 2.1, None, True, False, + {"a": 5, 2: np.linspace(0, 10, 1)}, + (4, 5), (10,), "ab\nx\"'"] for i in range(10): test_dict[str(i)] = i + for key, value in enumerate(test_values): + test_dict[key] = value + test_dict[1.5] = 1.5 test_dict["Finished"] = True @@ -30,9 +37,8 @@ class SyncStructCase(unittest.TestCase): return init def notify(self, mod): - print("mod: {}".format(mod)) if (mod["action"] == "init" and "Finished" in mod["struct"])\ - or (mod["action"] == "setitem" and mod["key"] == "Finished"): + or (mod["action"] == "setitem" and mod["key"] == "Finished"): self.receiving_done.set() def setUp(self):