From d008988843f61efb57cb06a30b8a47a357e248a4 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 22 Oct 2016 13:35:54 +0100 Subject: =?UTF-8?q?Manual=20cleanup=20of=20the=20remaining=20set([?= =?UTF-8?q?=E2=80=A6])=20and=20set((=E2=80=A6)).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_stanza_element.py | 4 ++-- tests/test_stanza_xep_0030.py | 14 +++++++------- tests/test_stream_presence.py | 2 +- tests/test_stream_xep_0030.py | 8 ++++---- tests/test_stream_xep_0047.py | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) (limited to 'tests') diff --git a/tests/test_stanza_element.py b/tests/test_stanza_element.py index 678a49fd..89ea0310 100644 --- a/tests/test_stanza_element.py +++ b/tests/test_stanza_element.py @@ -561,12 +561,12 @@ class TestElementBase(SlixTest): stanza = TestStanza() - self.failUnless(set(stanza.keys()) == set(('lang', 'bar', 'baz')), + self.failUnless(set(stanza.keys()) == {'lang', 'bar', 'baz'}, "Returned set of interface keys does not match expected.") stanza.enable('qux') - self.failUnless(set(stanza.keys()) == set(('lang', 'bar', 'baz', 'qux')), + self.failUnless(set(stanza.keys()) == {'lang', 'bar', 'baz', 'qux'}, "Incorrect set of interface and plugin keys.") def testGet(self): diff --git a/tests/test_stanza_xep_0030.py b/tests/test_stanza_xep_0030.py index 71dc7032..d85f1980 100644 --- a/tests/test_stanza_xep_0030.py +++ b/tests/test_stanza_xep_0030.py @@ -254,10 +254,10 @@ class TestDisco(SlixTest): iq['disco_info'].add_identity('client', 'pc', lang='en') iq['disco_info'].add_identity('client', 'pc', lang='fr') - expected = set([('client', 'pc', None, None), - ('client', 'pc', 'no', None), - ('client', 'pc', 'en', None), - ('client', 'pc', 'fr', None)]) + expected = {('client', 'pc', None, None), + ('client', 'pc', 'no', None), + ('client', 'pc', 'en', None), + ('client', 'pc', 'fr', None)} self.failUnless(iq['disco_info']['identities'] == expected, "Identities do not match:\n%s\n%s" % ( expected, @@ -472,9 +472,9 @@ class TestDisco(SlixTest): node='bar', name='Tester') - expected = set([('user@localhost', None, None), - ('user@localhost', 'foo', None), - ('test@localhost', 'bar', 'Tester')]) + expected = {('user@localhost', None, None), + ('user@localhost', 'foo', None), + ('test@localhost', 'bar', 'Tester')} self.failUnless(iq['disco_items']['items'] == expected, "Items do not match:\n%s\n%s" % ( expected, diff --git a/tests/test_stream_presence.py b/tests/test_stream_presence.py index 27559785..caf3fef9 100644 --- a/tests/test_stream_presence.py +++ b/tests/test_stream_presence.py @@ -38,7 +38,7 @@ class TestStreamPresence(SlixTest): to="tester@localhost"/> """) - self.assertEqual(events, set(('unavailable',)), + self.assertEqual(events, {'unavailable'}, "Got offline incorrectly triggered: %s." % events) def testGotOffline(self): diff --git a/tests/test_stream_xep_0030.py b/tests/test_stream_xep_0030.py index 1d6337d5..d1ad9087 100644 --- a/tests/test_stream_xep_0030.py +++ b/tests/test_stream_xep_0030.py @@ -307,7 +307,7 @@ class TestStreamDisco(SlixTest): """) - self.assertEqual(events, set(('disco_info',)), + self.assertEqual(events, {'disco_info'}, "Disco info event was not triggered: %s" % events) def testDynamicItemsJID(self): @@ -502,9 +502,9 @@ class TestStreamDisco(SlixTest): """) - items = set([('user@localhost', 'bar', 'Test'), - ('user@localhost', 'baz', 'Test 2')]) - self.assertEqual(events, set(('disco_items',)), + items = {('user@localhost', 'bar', 'Test'), + ('user@localhost', 'baz', 'Test 2')} + self.assertEqual(events, {'disco_items'}, "Disco items event was not triggered: %s" % events) self.assertEqual(results, items, "Unexpected items: %s" % results) diff --git a/tests/test_stream_xep_0047.py b/tests/test_stream_xep_0047.py index ecba2445..a0e6c227 100644 --- a/tests/test_stream_xep_0047.py +++ b/tests/test_stream_xep_0047.py @@ -77,7 +77,7 @@ class TestInBandByteStreams(SlixTest): from="tester@localhost/receiver" /> """) - self.assertEqual(events, set(['ibb_stream_start', 'callback'])) + self.assertEqual(events, {'ibb_stream_start', 'callback'}) @asyncio.coroutine def testSendData(self): -- cgit v1.2.3