diff options
author | Lance Stout <lancestout@gmail.com> | 2011-03-18 15:51:44 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-03-18 15:51:44 -0400 |
commit | f2c99798a6cf0dafe10fd547b036ecbb7a32569b (patch) | |
tree | 8a5d8192e3e0ed06cdb124a15daad5039a62e479 /tests/test_stanza_xep_0085.py | |
parent | d5b3a5282763e4f74816ff392bd8cd47dd9f7a95 (diff) | |
parent | 996ca52471931ccb3ac5a0f661e52fdc400db64b (diff) | |
download | slixmpp-f2c99798a6cf0dafe10fd547b036ecbb7a32569b.tar.gz slixmpp-f2c99798a6cf0dafe10fd547b036ecbb7a32569b.tar.bz2 slixmpp-f2c99798a6cf0dafe10fd547b036ecbb7a32569b.tar.xz slixmpp-f2c99798a6cf0dafe10fd547b036ecbb7a32569b.zip |
Merge branch 'develop' into stream_features
Diffstat (limited to 'tests/test_stanza_xep_0085.py')
-rw-r--r-- | tests/test_stanza_xep_0085.py | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/tests/test_stanza_xep_0085.py b/tests/test_stanza_xep_0085.py index 5db7139a..b08404e2 100644 --- a/tests/test_stanza_xep_0085.py +++ b/tests/test_stanza_xep_0085.py @@ -4,11 +4,7 @@ import sleekxmpp.plugins.xep_0085 as xep_0085 class TestChatStates(SleekTest): def setUp(self): - register_stanza_plugin(Message, xep_0085.Active) - register_stanza_plugin(Message, xep_0085.Composing) - register_stanza_plugin(Message, xep_0085.Gone) - register_stanza_plugin(Message, xep_0085.Inactive) - register_stanza_plugin(Message, xep_0085.Paused) + register_stanza_plugin(Message, xep_0085.ChatState) def testCreateChatState(self): """Testing creating chat states.""" @@ -20,25 +16,26 @@ class TestChatStates(SleekTest): """ msg = self.Message() - msg['chat_state'].active() - self.check(msg, xmlstring % 'active', - use_values=False) - msg['chat_state'].composing() - self.check(msg, xmlstring % 'composing', - use_values=False) + self.assertEqual(msg['chat_state'], '') + self.check(msg, "<message />", use_values=False) + msg['chat_state'] = 'active' + self.check(msg, xmlstring % 'active', use_values=False) - msg['chat_state'].gone() - self.check(msg, xmlstring % 'gone', - use_values=False) + msg['chat_state'] = 'composing' + self.check(msg, xmlstring % 'composing', use_values=False) - msg['chat_state'].inactive() - self.check(msg, xmlstring % 'inactive', - use_values=False) + msg['chat_state'] = 'gone' + self.check(msg, xmlstring % 'gone', use_values=False) - msg['chat_state'].paused() - self.check(msg, xmlstring % 'paused', - use_values=False) + msg['chat_state'] = 'inactive' + self.check(msg, xmlstring % 'inactive', use_values=False) + + msg['chat_state'] = 'paused' + self.check(msg, xmlstring % 'paused', use_values=False) + + del msg['chat_state'] + self.check(msg, "<message />") suite = unittest.TestLoader().loadTestsFromTestCase(TestChatStates) |