From 17174016ec6603afe87a65282f9b7eb55f2eafeb Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 17 Aug 2014 21:53:34 +0200 Subject: Remove all trailing whitespaces. --- tests/test_plugins.py | 2 +- tests/test_stanza_xep_0323.py | 42 +++++----- tests/test_stanza_xep_0325.py | 6 +- tests/test_stream_xep_0323.py | 182 +++++++++++++++++++++--------------------- tests/test_stream_xep_0325.py | 28 +++---- 5 files changed, 130 insertions(+), 130 deletions(-) (limited to 'tests') diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 510ae7d7..ee6d44c0 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -77,7 +77,7 @@ class TestPlugins(unittest.TestCase): p.disable('a') self.assertEqual(len(p), 0, "Wrong number of enabled plugins.") - self.assertEqual(events, ['init', 'end'], + self.assertEqual(events, ['init', 'end'], "Plugin lifecycle methods not called.") def test_enable_dependencies(self): diff --git a/tests/test_stanza_xep_0323.py b/tests/test_stanza_xep_0323.py index 405245b5..95fb138b 100644 --- a/tests/test_stanza_xep_0323.py +++ b/tests/test_stanza_xep_0323.py @@ -6,7 +6,7 @@ import slixmpp.plugins.xep_0323 as xep_0323 namespace='sn' class TestSensorDataStanzas(SlixTest): - + def setUp(self): pass @@ -171,7 +171,7 @@ class TestSensorDataStanzas(SlixTest): iq['accepted']['seqnr'] = '2' self.check(iq,""" - @@ -193,7 +193,7 @@ class TestSensorDataStanzas(SlixTest): iq['rejected']['error'] = 'Access denied.' self.check(iq,""" - @@ -250,7 +250,7 @@ class TestSensorDataStanzas(SlixTest): - + @@ -269,7 +269,7 @@ class TestSensorDataStanzas(SlixTest): - + @@ -314,7 +314,7 @@ class TestSensorDataStanzas(SlixTest): - + @@ -323,18 +323,18 @@ class TestSensorDataStanzas(SlixTest): - - - - - - - - - - - - + + + + + + + + + + + + @@ -342,7 +342,7 @@ class TestSensorDataStanzas(SlixTest): """ ) - + def testTimestamp(self): msg = self.Message(); @@ -386,8 +386,8 @@ class TestSensorDataStanzas(SlixTest): self.check(msg,emptyStringIdXML) msg['fields']['stringIds'] = "1" self.check(msg,emptyStringIdXML) - - + + suite = unittest.TestLoader().loadTestsFromTestCase(TestSensorDataStanzas) diff --git a/tests/test_stanza_xep_0325.py b/tests/test_stanza_xep_0325.py index 222e10ea..75a45907 100644 --- a/tests/test_stanza_xep_0325.py +++ b/tests/test_stanza_xep_0325.py @@ -15,7 +15,7 @@ import slixmpp.plugins.xep_0325 as xep_0325 namespace='sn' class TestControlStanzas(SlixTest): - + def setUp(self): pass @@ -89,7 +89,7 @@ class TestControlStanzas(SlixTest): msg['set'].add_data("Tjohej", "boolean", "true") self.check(msg,""" - @@ -244,5 +244,5 @@ class TestControlStanzas(SlixTest): """ ) - + suite = unittest.TestLoader().loadTestsFromTestCase(TestControlStanzas) diff --git a/tests/test_stream_xep_0323.py b/tests/test_stream_xep_0323.py index 3f54d861..d8e3b01f 100644 --- a/tests/test_stream_xep_0323.py +++ b/tests/test_stream_xep_0323.py @@ -46,7 +46,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -60,11 +60,11 @@ class TestStreamSensorData(SlixTest): - + - + """) def testRequestRejectAuth(self): @@ -85,7 +85,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -118,7 +118,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -142,7 +142,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -177,7 +177,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -201,7 +201,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -215,11 +215,11 @@ class TestStreamSensorData(SlixTest): - + - + """) self.send(""" @@ -227,7 +227,7 @@ class TestStreamSensorData(SlixTest): to='master@clayster.com/amr'> - + """) def testRequestMultiTimestampSingleField(self): @@ -260,7 +260,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -274,11 +274,11 @@ class TestStreamSensorData(SlixTest): - + - + """) self.send(""" @@ -287,11 +287,11 @@ class TestStreamSensorData(SlixTest): - + - + """) self.send(""" @@ -299,7 +299,7 @@ class TestStreamSensorData(SlixTest): to='master@clayster.com/amr'> - + """) def testRequestMultiTimestampAllFields(self): @@ -330,7 +330,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -344,11 +344,11 @@ class TestStreamSensorData(SlixTest): - + - + """) self.send(""" @@ -357,12 +357,12 @@ class TestStreamSensorData(SlixTest): - - + + - + """) self.send(""" @@ -370,7 +370,7 @@ class TestStreamSensorData(SlixTest): to='master@clayster.com/amr'> - + """) def testRequestAPI(self): @@ -424,7 +424,7 @@ class TestStreamSensorData(SlixTest): plugins=['xep_0030', 'xep_0323']) - results = []; + results = []; def my_callback(from_jid, result, nodeId=None, timestamp=None, fields=None, error_msg=None): if (result == "rejected") and (error_msg == "Invalid device Device22"): @@ -445,19 +445,19 @@ class TestStreamSensorData(SlixTest): """) self.recv(""" - Invalid device Device22 - + """) time.sleep(.1) - self.failUnless(results == ["rejected"], + self.failUnless(results == ["rejected"], "Rejected callback was not properly executed"); def testRequestAcceptedAPI(self): @@ -466,7 +466,7 @@ class TestStreamSensorData(SlixTest): plugins=['xep_0030', 'xep_0323']) - results = []; + results = []; def my_callback(from_jid, result, nodeId=None, timestamp=None, fields=None, error_msg=None): results.append(result); @@ -486,17 +486,17 @@ class TestStreamSensorData(SlixTest): """) self.recv(""" - - + """) time.sleep(.1) - self.failUnless(results == ["accepted"], + self.failUnless(results == ["accepted"], "Accepted callback was not properly executed"); def testRequestFieldsAPI(self): @@ -505,8 +505,8 @@ class TestStreamSensorData(SlixTest): plugins=['xep_0030', 'xep_0323']) - results = []; - callback_data = {}; + results = []; + callback_data = {}; def my_callback(from_jid, result, nodeId=None, timestamp=None, fields=None, error_msg=None): results.append(result); @@ -519,9 +519,9 @@ class TestStreamSensorData(SlixTest): 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'], + 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); @@ -538,12 +538,12 @@ class TestStreamSensorData(SlixTest): """) self.recv(""" - - + """) self.recv(""" @@ -552,19 +552,19 @@ class TestStreamSensorData(SlixTest): - - + + - + """) self.recv(""" - + """) t1.join(); @@ -605,8 +605,8 @@ class TestStreamSensorData(SlixTest): - - + + """) def testServiceDiscoveryComponent(self): @@ -631,8 +631,8 @@ class TestStreamSensorData(SlixTest): - - + + """) def testRequestTimeout(self): @@ -642,7 +642,7 @@ class TestStreamSensorData(SlixTest): 'xep_0323']) results = []; - callback_data = {}; + callback_data = {}; def my_callback(from_jid, result, nodeId=None, timestamp=None, error_msg=None): results.append(result); @@ -653,9 +653,9 @@ class TestStreamSensorData(SlixTest): 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'], + kwargs={"from_jid": "tester@localhost", + "to_jid": "you@google.com", + "nodeIds": ['Device33'], "callback": my_callback}); t1.start(); @@ -671,12 +671,12 @@ class TestStreamSensorData(SlixTest): """) self.recv(""" - - + """) self.recv(""" @@ -729,7 +729,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -743,7 +743,7 @@ class TestStreamSensorData(SlixTest): - + """) self.send(""" @@ -752,11 +752,11 @@ class TestStreamSensorData(SlixTest): - + - + """) def testDelayedRequestFail(self): @@ -792,7 +792,7 @@ class TestStreamSensorData(SlixTest): xml_stanza['rejected']['error'] = error_text self._filtered_stanza_check(""" - @@ -847,7 +847,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -861,11 +861,11 @@ class TestStreamSensorData(SlixTest): - + - + """) self.send(""" @@ -874,11 +874,11 @@ class TestStreamSensorData(SlixTest): - + - + """) self.send(""" @@ -886,7 +886,7 @@ class TestStreamSensorData(SlixTest): to='master@clayster.com/amr'> - + """) def testRequestFieldTo(self): @@ -917,7 +917,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -931,11 +931,11 @@ class TestStreamSensorData(SlixTest): - + - + """) self.send(""" @@ -944,11 +944,11 @@ class TestStreamSensorData(SlixTest): - + - + """) self.send(""" @@ -956,7 +956,7 @@ class TestStreamSensorData(SlixTest): to='master@clayster.com/amr'> - + """) def testRequestFieldFromTo(self): @@ -987,7 +987,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - @@ -1001,11 +1001,11 @@ class TestStreamSensorData(SlixTest): - + - + """) self.send(""" @@ -1013,7 +1013,7 @@ class TestStreamSensorData(SlixTest): to='master@clayster.com/amr'> - + """) def testDelayedRequestClient(self): @@ -1021,8 +1021,8 @@ class TestStreamSensorData(SlixTest): plugins=['xep_0030', 'xep_0323']) - results = []; - callback_data = {}; + results = []; + callback_data = {}; def my_callback(from_jid, result, nodeId=None, timestamp=None, fields=None, error_msg=None): results.append(result); @@ -1035,9 +1035,9 @@ class TestStreamSensorData(SlixTest): 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'], + 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); @@ -1054,20 +1054,20 @@ class TestStreamSensorData(SlixTest): """) self.recv(""" - - + """) self.recv(""" - - """) + + """) self.recv(""" - - + + - + """) self.recv(""" - + """) t1.join(); @@ -1114,7 +1114,7 @@ class TestStreamSensorData(SlixTest): plugins=['xep_0030', 'xep_0323']) - results = []; + results = []; def my_callback(from_jid, result, nodeId=None, timestamp=None, fields=None, error_msg=None): results.append(result); @@ -1133,12 +1133,12 @@ class TestStreamSensorData(SlixTest): """) self.recv(""" - - + """) self.xmpp['xep_0323'].cancel_request(session=session); @@ -1192,7 +1192,7 @@ class TestStreamSensorData(SlixTest): """) self.send(""" - diff --git a/tests/test_stream_xep_0325.py b/tests/test_stream_xep_0325.py index b85342ff..0d4ab907 100644 --- a/tests/test_stream_xep_0325.py +++ b/tests/test_stream_xep_0325.py @@ -60,7 +60,7 @@ class TestStreamControl(SlixTest): to='master@clayster.com/amr' id='1'> - + """) self.assertEqual(myDevice._get_field_value("Temperature"), "17"); @@ -99,7 +99,7 @@ class TestStreamControl(SlixTest): to='master@clayster.com/amr' id='1'> - + """) self.assertEqual(myDevice._get_field_value("Temperature"), "17"); @@ -125,7 +125,7 @@ class TestStreamControl(SlixTest): to='master@clayster.com/amr' id='2'> - + """) self.assertEqual(myDevice._get_field_value("Temperature"), "20"); @@ -163,7 +163,7 @@ class TestStreamControl(SlixTest): Invalid field Voltage - + """) self.assertEqual(myDevice._get_field_value("Temperature"), "15"); @@ -180,7 +180,7 @@ class TestStreamControl(SlixTest): self.xmpp['xep_0325'].register_node(nodeId="Device22", device=myDevice, commTimeout=0.5); self.recv(""" - @@ -204,7 +204,7 @@ class TestStreamControl(SlixTest): self.xmpp['xep_0325'].register_node(nodeId="Device22", device=myDevice, commTimeout=0.5); self.recv(""" - @@ -225,7 +225,7 @@ class TestStreamControl(SlixTest): plugins=['xep_0030', 'xep_0325']) - results = []; + results = []; def my_callback(from_jid, result, nodeIds=None, fields=None, error_msg=None): results.append(result); @@ -256,7 +256,7 @@ class TestStreamControl(SlixTest): to='tester@localhost' id='1'> - + """) time.sleep(.5) @@ -269,7 +269,7 @@ class TestStreamControl(SlixTest): plugins=['xep_0030', 'xep_0325']) - results = []; + results = []; def my_callback(from_jid, result, nodeIds=None, fields=None, error_msg=None): results.append(result); @@ -302,7 +302,7 @@ class TestStreamControl(SlixTest): Sensor error - + """) time.sleep(.5) @@ -330,8 +330,8 @@ class TestStreamControl(SlixTest): - - + + """) def testServiceDiscoveryComponent(self): @@ -356,8 +356,8 @@ class TestStreamControl(SlixTest): - - + + """) -- cgit v1.2.3