summaryrefslogtreecommitdiff
path: root/tests/test_stream_xep_0323.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_stream_xep_0323.py')
-rw-r--r--tests/test_stream_xep_0323.py52
1 files changed, 13 insertions, 39 deletions
diff --git a/tests/test_stream_xep_0323.py b/tests/test_stream_xep_0323.py
index d8e3b01f..1a25ec2a 100644
--- a/tests/test_stream_xep_0323.py
+++ b/tests/test_stream_xep_0323.py
@@ -455,8 +455,6 @@ class TestStreamSensorData(SlixTest):
</iq>
""")
- time.sleep(.1)
-
self.failUnless(results == ["rejected"],
"Rejected callback was not properly executed");
@@ -494,8 +492,6 @@ class TestStreamSensorData(SlixTest):
</iq>
""")
- time.sleep(.1)
-
self.failUnless(results == ["accepted"],
"Accepted callback was not properly executed");
@@ -517,13 +513,10 @@ class TestStreamSensorData(SlixTest):
for f in fields:
callback_data["field_" + f['name']] = f;
- t1= threading.Thread(name="request_data",
- target=self.xmpp['xep_0323'].request_data,
- kwargs={"from_jid": "tester@localhost",
- "to_jid": "you@google.com",
- "nodeIds": ['Device33'],
- "callback": my_callback});
- t1.start();
+ self.xmpp['xep_0323'].request_data(from_jid="tester@localhost",
+ to_jid="you@google.com",
+ nodeIds=['Device33'],
+ callback=my_callback)
#self.xmpp['xep_0323'].request_data(from_jid="tester@localhost", to_jid="you@google.com", nodeIds=['Device33'], callback=my_callback);
self.send("""
@@ -567,9 +560,6 @@ class TestStreamSensorData(SlixTest):
</message>
""")
- t1.join();
- time.sleep(.5)
-
self.failUnlessEqual(results, ["accepted","fields","done"]);
# self.assertIn("nodeId", callback_data);
self.assertTrue("nodeId" in callback_data)
@@ -651,13 +641,10 @@ class TestStreamSensorData(SlixTest):
callback_data["timestamp"] = timestamp;
callback_data["error_msg"] = error_msg;
- t1= threading.Thread(name="request_data",
- target=self.xmpp['xep_0323'].request_data,
- kwargs={"from_jid": "tester@localhost",
- "to_jid": "you@google.com",
- "nodeIds": ['Device33'],
- "callback": my_callback});
- t1.start();
+ self.xmpp['xep_0323'].request_data(from_jid="tester@localhost",
+ to_jid="you@google.com",
+ nodeIds=['Device33'],
+ callback=my_callback)
self.send("""
<iq type='get'
@@ -688,9 +675,6 @@ class TestStreamSensorData(SlixTest):
</message>
""")
- t1.join();
- time.sleep(.5)
-
self.failUnlessEqual(results, ["accepted","failure"]);
# self.assertIn("nodeId", callback_data);
self.assertTrue("nodeId" in callback_data);
@@ -737,7 +721,7 @@ class TestStreamSensorData(SlixTest):
</iq>
""")
- time.sleep(2)
+ time.sleep(1)
self.send("""
<message from='device@clayster.com'
@@ -1033,13 +1017,10 @@ class TestStreamSensorData(SlixTest):
for f in fields:
callback_data["field_" + f['name']] = f;
- t1= threading.Thread(name="request_data",
- target=self.xmpp['xep_0323'].request_data,
- kwargs={"from_jid": "tester@localhost",
- "to_jid": "you@google.com",
- "nodeIds": ['Device33'],
- "callback": my_callback});
- t1.start();
+ self.xmpp['xep_0323'].request_data(from_jid="tester@localhost",
+ to_jid="you@google.com",
+ nodeIds=['Device33'],
+ callback=my_callback)
#self.xmpp['xep_0323'].request_data(from_jid="tester@localhost", to_jid="you@google.com", nodeIds=['Device33'], callback=my_callback);
self.send("""
@@ -1090,9 +1071,6 @@ class TestStreamSensorData(SlixTest):
</message>
""")
- t1.join();
- time.sleep(.5)
-
self.failUnlessEqual(results, ["queued","started","fields","done"]);
# self.assertIn("nodeId", callback_data);
self.assertTrue("nodeId" in callback_data);
@@ -1161,8 +1139,6 @@ class TestStreamSensorData(SlixTest):
</iq>
""")
- time.sleep(.5)
-
self.failUnlessEqual(results, ["accepted","cancelled"]);
def testDelayedRequestCancel(self):
@@ -1239,8 +1215,6 @@ class TestStreamSensorData(SlixTest):
</iq>
""")
- time.sleep(2)
-
# Ensure we don't get anything after cancellation
self.send(None)