From 96eba1438b99b661abb5a9374a4617a56a7f8937 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 20 Sep 2013 14:43:37 +0100 Subject: [PATCH 1/4] Tests: replace GetSelfHandle calls with property-getting sed expression: s/\.GetSelfHandle()/.Properties.Get(cs.CONN, "SelfHandle")/g adjusted by hand to add "import constants as cs" where needed. --- tests/twisted/roster/groups.py | 2 +- tests/twisted/roster/publish.py | 2 +- tests/twisted/roster/subscribe.py | 2 +- tests/twisted/text/destroy.py | 3 ++- tests/twisted/text/ensure.py | 2 +- tests/twisted/text/initiate-requestotron.py | 2 +- tests/twisted/text/initiate.py | 3 ++- tests/twisted/text/respawn.py | 3 ++- 8 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/twisted/roster/groups.py b/tests/twisted/roster/groups.py index 8f8f2c9..0420e19 100644 --- a/tests/twisted/roster/groups.py +++ b/tests/twisted/roster/groups.py @@ -14,7 +14,7 @@ import constants as cs import ns def test(q, bus, conn, stream): - self_handle = conn.GetSelfHandle() + self_handle = conn.Properties.Get(cs.CONN, "SelfHandle") # Close all Group channels to get a clean slate, so we can rely on # the NewChannels signal for the default group later diff --git a/tests/twisted/roster/publish.py b/tests/twisted/roster/publish.py index f04abca..e8f5b2d 100644 --- a/tests/twisted/roster/publish.py +++ b/tests/twisted/roster/publish.py @@ -74,7 +74,7 @@ def test(q, bus, conn, stream): args=['', [alice], [], [], [], 0, cs.GC_REASON_NONE]), ) - self_handle = conn.GetSelfHandle() + self_handle = conn.Properties.Get(cs.CONN, "SelfHandle") # accept call_async(q, publish.Group, 'AddMembers', [alice], '') diff --git a/tests/twisted/roster/subscribe.py b/tests/twisted/roster/subscribe.py index f6225de..102ab71 100644 --- a/tests/twisted/roster/subscribe.py +++ b/tests/twisted/roster/subscribe.py @@ -13,7 +13,7 @@ import constants as cs import ns def test(q, bus, conn, stream): - self_handle = conn.GetSelfHandle() + self_handle = conn.Properties.Get(cs.CONN, "SelfHandle") # Close all Group channels to get a clean slate, so we can rely on # the NewChannels signal for the default group later diff --git a/tests/twisted/text/destroy.py b/tests/twisted/text/destroy.py index 1b5e8fb..5860219 100644 --- a/tests/twisted/text/destroy.py +++ b/tests/twisted/text/destroy.py @@ -9,9 +9,10 @@ from twisted.words.xish import domish from hazetest import exec_test from servicetest import call_async, EventPattern, assertEquals +import constants as cs def test(q, bus, conn, stream): - self_handle = conn.GetSelfHandle() + self_handle = conn.Properties.Get(cs.CONN, "SelfHandle") jid = 'foo@bar.com' call_async(q, conn, 'RequestHandles', 1, [jid]) diff --git a/tests/twisted/text/ensure.py b/tests/twisted/text/ensure.py index 21876c3..2aebf8c 100644 --- a/tests/twisted/text/ensure.py +++ b/tests/twisted/text/ensure.py @@ -14,7 +14,7 @@ import pprint import constants as cs def test(q, bus, conn, stream): - self_handle = conn.GetSelfHandle() + self_handle = conn.Properties.Get(cs.CONN, "SelfHandle") jids = ['foo@bar.com', 'truc@cafe.fr'] call_async(q, conn, 'RequestHandles', 1, jids) diff --git a/tests/twisted/text/initiate-requestotron.py b/tests/twisted/text/initiate-requestotron.py index a116d2c..9e52c34 100644 --- a/tests/twisted/text/initiate-requestotron.py +++ b/tests/twisted/text/initiate-requestotron.py @@ -12,7 +12,7 @@ from servicetest import call_async, EventPattern import constants as cs def test(q, bus, conn, stream): - self_handle = conn.GetSelfHandle() + self_handle = conn.Properties.Get(cs.CONN, "SelfHandle") jid = 'foo@bar.com' call_async(q, conn, 'RequestHandles', 1, [jid]) diff --git a/tests/twisted/text/initiate.py b/tests/twisted/text/initiate.py index 88d8117..e93d318 100644 --- a/tests/twisted/text/initiate.py +++ b/tests/twisted/text/initiate.py @@ -8,9 +8,10 @@ from twisted.words.xish import domish from hazetest import exec_test from servicetest import call_async, EventPattern +import constants as cs def test(q, bus, conn, stream): - self_handle = conn.GetSelfHandle() + self_handle = conn.Properties.Get(cs.CONN, "SelfHandle") jid = 'foo@bar.com' call_async(q, conn, 'RequestHandles', 1, [jid]) diff --git a/tests/twisted/text/respawn.py b/tests/twisted/text/respawn.py index baf5a3d..52b5e88 100644 --- a/tests/twisted/text/respawn.py +++ b/tests/twisted/text/respawn.py @@ -8,9 +8,10 @@ from twisted.words.xish import domish from hazetest import exec_test from servicetest import call_async, EventPattern, assertEquals +import constants as cs def test(q, bus, conn, stream): - self_handle = conn.GetSelfHandle() + self_handle = conn.Properties.Get(cs.CONN, "SelfHandle") jid = 'foo@bar.com' call_async(q, conn, 'RequestHandles', 1, [jid]) -- 1.8.4.rc3