[telepathy-gabble/telepathy-gabble-0.8] Shove the test name into 'account' as the resource

Will Thompson will.thompson at collabora.co.uk
Tue Dec 8 03:30:17 PST 2009


This means the name of (most) tests appears in gabble-testing.log;
'resource' takes priority so the test jid still comes out as
test at localhost/Resource.
---
 tests/twisted/gabbletest.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py
index b0d4e71..fa45c27 100644
--- a/tests/twisted/gabbletest.py
+++ b/tests/twisted/gabbletest.py
@@ -8,6 +8,7 @@ import os
 import hashlib
 import sys
 import random
+import re
 import traceback
 
 import ns
@@ -300,8 +301,11 @@ class GoogleXmlStream(BaseXmlStream):
             self.send(iq)
 
 def make_connection(bus, event_func, params=None):
+    # Gabble accepts a resource in 'account', but the value of 'resource'
+    # overrides it if there is one.
+    account = 'test at localhost/%s' % re.sub(r'.*tests/twisted/', '', sys.argv[0])
     default_params = {
-        'account': 'test at localhost/Resource',
+        'account': account,
         'password': 'pass',
         'resource': 'Resource',
         'server': 'localhost',
-- 
1.5.6.5




More information about the telepathy-commits mailing list