Skip to content

Commit b27254b

Browse files
committedJun 3, 2015
sync_struct test: test more cases, pep8 fix, remove print
1 parent b8bdce5 commit b27254b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎artiq/test/sync_struct.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import unittest
22
import asyncio
3+
import numpy as np
34

45
from artiq.protocols import sync_struct
56

@@ -9,8 +10,14 @@
910

1011
@asyncio.coroutine
1112
def write_test_data(test_dict):
13+
test_values = [5, 2.1, None, True, False,
14+
{"a": 5, 2: np.linspace(0, 10, 1)},
15+
(4, 5), (10,), "ab\nx\"'"]
Has conversations. Original line has conversations.
1216
for i in range(10):
1317
test_dict[str(i)] = i
18+
for key, value in enumerate(test_values):
19+
test_dict[key] = value
20+
test_dict[1.5] = 1.5
1421
test_dict["Finished"] = True
1522

1623

@@ -30,9 +37,8 @@ def init_test_dict(self, init):
3037
return init
3138

3239
def notify(self, mod):
33-
print("mod: {}".format(mod))
3440
if (mod["action"] == "init" and "Finished" in mod["struct"])\
35-
or (mod["action"] == "setitem" and mod["key"] == "Finished"):
41+
or (mod["action"] == "setitem" and mod["key"] == "Finished"):
3642
self.receiving_done.set()
3743

3844
def setUp(self):

0 commit comments

Comments
 (0)
Please sign in to comment.