[Telepathy-commits] [telepathy-gabble/master] Regression test: don't crash when setting presence with open MUC Tubes
Will Thompson
will.thompson at collabora.co.uk
Thu Dec 25 03:15:58 PST 2008
---
tests/twisted/Makefile.am | 1 +
tests/twisted/tubes/muc-presence.py | 27 +++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)
create mode 100644 tests/twisted/tubes/muc-presence.py
diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index 8a223fb..f29c89a 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -36,6 +36,7 @@ TWISTED_TESTS = \
text/test-text-delayed.py \
text/test-text-no-body.py \
text/test-text.py \
+ tubes/muc-presence.py \
tubes/test-get-available-tubes.py \
tubes/test-muc-accept-stream-tube-ibb.py \
tubes/test-muc-offer-dbus-tube.py \
diff --git a/tests/twisted/tubes/muc-presence.py b/tests/twisted/tubes/muc-presence.py
new file mode 100644
index 0000000..a8713c4
--- /dev/null
+++ b/tests/twisted/tubes/muc-presence.py
@@ -0,0 +1,27 @@
+"""
+Regression test for a bug where, if you had any MUC Tubes channels open and
+changed your presence, a GabbleMucChannel method was called on a
+GabbleTubesChannel, crashing Gabble.
+"""
+
+from gabbletest import exec_test
+
+from muctubeutil import get_muc_tubes_channel
+
+def test(q, bus, conn, stream):
+ conn.Connect()
+
+ _ = q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+
+ handles, tubes_chan, tubes_iface = get_muc_tubes_channel(q, bus, conn,
+ stream, 'chat at conf.localhost')
+
+ conn.Presence.SetStatus({'away':{'message':'Christmas lunch!'}})
+
+ # If Gabble didn't crash, we're done.
+ conn.Disconnect()
+
+ q.expect('dbus-signal', signal='StatusChanged', args=[2, 1])
+
+if __name__ == '__main__':
+ exec_test(test)
--
1.5.6.5
More information about the Telepathy-commits
mailing list