summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2009-11-06 19:35:59 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2009-11-06 19:35:59 +0000
commitae8366c3cfec5a5f2589b216847369c237259edf (patch)
tree1c94f84b1323d7d9d215d3454769122911afd4f5
parentffbdb256a24af0095f45e81820d6d4ee15399fbc (diff)
Assert that redundant chat state changes aren't signalledchat-state-recovery
-rw-r--r--tests/twisted/text/test-chat-state.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/twisted/text/test-chat-state.py b/tests/twisted/text/test-chat-state.py
index d1acd6dd2..247b35cee 100644
--- a/tests/twisted/text/test-chat-state.py
+++ b/tests/twisted/text/test-chat-state.py
@@ -6,7 +6,8 @@ channels.
from twisted.words.xish import domish
-from servicetest import call_async, assertEquals, wrap_channel, EventPattern
+from servicetest import (call_async, assertEquals, wrap_channel, EventPattern,
+ sync_dbus)
from gabbletest import exec_test, make_result_iq, sync_stream, make_presence
import constants as cs
import ns
@@ -87,6 +88,23 @@ def test(q, bus, conn, stream):
assertEquals(foo_handle, handle)
assertEquals(cs.CHAT_STATE_ACTIVE, state)
+ # Assert that a redundant chat-state change doesn't emit a signal
+
+ forbidden = [EventPattern('dbus-signal', signal='ChatStateChanged',
+ args=[foo_handle, cs.CHAT_STATE_ACTIVE])]
+ q.forbid_events(forbidden)
+
+ m = domish.Element((None, 'message'))
+ m['from'] = 'foo@bar.com/Foo'
+ m['type'] = 'chat'
+ m.addElement((ns.CHAT_STATES, 'active'))
+ m.addElement('body', content='hello')
+ stream.send(m)
+
+ sync_dbus(bus, q, conn)
+
+ q.unforbid_events(forbidden)
+
# Sending chat states:
# Composing...