Commit 04bac0da authored by Olivier R-D's avatar Olivier R-D

one more python2 hack, renenable event testing

parent 6d76e222
...@@ -137,9 +137,6 @@ def unpack_uatype_array(uatype, data): ...@@ -137,9 +137,6 @@ def unpack_uatype_array(uatype, data):
result.append(unpack_uatype(uatype, data)) result.append(unpack_uatype(uatype, data))
return result return result
def pack_string(string): def pack_string(string):
length = len(string) length = len(string)
if length == 0: if length == 0:
...@@ -158,7 +155,8 @@ def unpack_bytes(data): ...@@ -158,7 +155,8 @@ def unpack_bytes(data):
def unpack_string(data): def unpack_string(data):
b = unpack_bytes(data) b = unpack_bytes(data)
#return str(b, "utf-8") if sys.version_info.major < 3:
return str(b)
return b.decode("utf-8") return b.decode("utf-8")
def test_bit(data, offset): def test_bit(data, offset):
......
...@@ -48,7 +48,7 @@ class MySubHandler(): ...@@ -48,7 +48,7 @@ class MySubHandler():
self.future.set_result((handle, node, val, attr)) self.future.set_result((handle, node, val, attr))
def event(self, handle, event): def event(self, handle, event):
self.future.set_result((handle, node, val, attr)) self.future.set_result((handle, event))
class Unit(unittest.TestCase): class Unit(unittest.TestCase):
...@@ -273,7 +273,7 @@ class CommonTests(object): ...@@ -273,7 +273,7 @@ class CommonTests(object):
sub.unsubscribe(handle) sub.unsubscribe(handle)
sub.delete() sub.delete()
def _test_events(self): def test_events(self):
msclt = MySubHandler() msclt = MySubHandler()
#cond = msclt.setup() #cond = msclt.setup()
sub = self.opc.create_subscription(100, msclt) sub = self.opc.create_subscription(100, msclt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment