summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Laban <david.laban@collabora.co.uk>2011-05-31 16:10:16 -0400
committerDavid Laban <david.laban@collabora.co.uk>2011-07-06 15:39:22 -0400
commit38a6178a7529e3b1bf1ab8439185541e01c18dd5 (patch)
tree55aff9ffafa60ac9194cf2ca86f917851ba1cbe3 /tests
parentc356abc2de2b33cb250b143bb5a8b28068971f4d (diff)
test-debug.py: actually check that no debugging happens
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/test-debug.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/twisted/test-debug.py b/tests/twisted/test-debug.py
index 39b520c4..fb52c636 100644
--- a/tests/twisted/test-debug.py
+++ b/tests/twisted/test-debug.py
@@ -5,14 +5,10 @@ Test the debug message interface.
import dbus
+from servicetest import assertEquals, sync_dbus
from gabbletest import exec_test
import constants as cs
from config import DEBUGGING
-
-if not DEBUGGING:
- print " -- Not testing debugger, built with --disable-debug"
- raise SystemExit(77)
-
path = '/org/freedesktop/Telepathy/debug'
iface = 'org.freedesktop.Telepathy.Debug'
@@ -35,17 +31,30 @@ def test(q, bus, conn, stream):
assert props_iface.Get(iface, 'Enabled') == False
props_iface.Set(iface, 'Enabled', True)
- conn.RequestChannel(
+ channel_path = conn.RequestChannel(
cs.CHANNEL_TYPE_TEXT, cs.HT_CONTACT, conn.GetSelfHandle(), True)
q.expect('dbus-signal', signal='NewChannel')
- assert len(messages) > 0
- # Turn signalling off and check we have no new messages.
+ if DEBUGGING:
+ assert len(messages) > 0
+ else:
+ assertEquals([], messages)
+
+ # Turn signalling off and check we don't get any more messages.
props_iface.Set(iface, 'Enabled', False)
+ sync_dbus(bus, q, conn)
snapshot = list(messages)
- assert snapshot == messages
+ channel = bus.get_object(conn.bus_name, channel_path)
+ channel.Close(dbus_interface=cs.CHANNEL)
+ q.expect('dbus-signal', signal='Closed')
+
+ conn.RequestChannel(
+ cs.CHANNEL_TYPE_TEXT, cs.HT_CONTACT, conn.GetSelfHandle(), True)
+ q.expect('dbus-signal', signal='NewChannel')
+
+ assertEquals (snapshot, messages)
if __name__ == '__main__':
exec_test(test)