summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2011-04-08Merge branch 'develop' into rosterLance Stout
2011-04-08Update tests to reflect XEP-0086 correcting error codes.Lance Stout
2011-03-24Merge branch 'develop' into rosterLance Stout
2011-03-24Added new implementation for XEP-0086.Lance Stout
2011-03-24Allow a stanza plugin to override a parent's interfaces.Lance Stout
Each interface, say foo, may be overridden in three ways: set_foo get_foo del_foo To declare an override in a plugin, add the class field overrides as so: overrides = ['set_foo', 'del_foo'] Each override must have a matching set_foo(), etc method for implementing the new behaviour. To enable the overrides for a particular parent stanza, pass the option overrides=True to register_stanza_plugin. register_stanza_plugin(Stanza, Plugin, overrides=True) Example code: class Test(ElementBase): name = 'test' namespace = 'testing' interfaces = set(('foo', 'bar')) sub_interfaces = set(('bar',)) class TestOverride(ElementBase): name = 'test-override' namespace = 'testing' plugin_attrib = 'override' interfaces = set(('foo',)) overrides = ['set_foo'] def setup(self, xml): # Don't include an XML element in the parent stanza # since we're adding just an attribute. # If adding a regular subelement, no need to do this. self.xml = ET.Element('') def set_foo(self, value): print("overrides!") self.parent()._set_attr('foo', 'override-%s' % value) register_stanza_plugin(Test, TestOverride, overrides=True) Example usage: >>> t = TestStanza() >>> t['foo'] = 'bar' >>> t['foo'] 'override-bar'
2011-03-24Merge branch 'develop' into rosterLance Stout
2011-03-24Added new XEP-0050 implementation.Lance Stout
Backward incompatibility alert! Please see examples/adhoc_provider.py for how to use the new plugin implementation, or the test examples in the files tests/test_stream_xep_0050.py and tests/test_stanza_xep_0050.py. Major changes: - May now have zero-step commands. Useful if a command is intended to be a dynamic status report that doesn't require any user input. - May use payloads other than data forms, such as a completely custom stanza type. - May include multiple payload items, such as multiple data forms, or a form and a custom stanza type. - Includes a command user API for calling adhoc commands on remote agents and managing the workflow. - Added support for note elements. Todo: - Add prev action support. You may use register_plugin('old_0050') to continue using the previous XEP-0050 implementation.
2011-03-23Merge branch 'develop' into rosterLance Stout
2011-03-23Cleaned XEP-0249 plugin, added tests.Lance Stout
2011-03-22Merge branch 'develop' into rosterLance Stout
2011-03-22Updated XEP-0128 plugin to work with the new XEP-0030 plugin.Lance Stout
Required fixing a few bugs in StanzaBase related to iterable substanzas.
2011-02-24Merge branch 'develop' into rosterLance Stout
2011-02-24Add tests for XEP-0085, fix some bugs.Lance Stout
2011-02-24Updated the XEP-0085 plugin.Lance Stout
Can now be used as so: >>> msg['chat_state'] '' >>> msg <message /> >>> msg['chat_state'] = 'paused' >>> msg <message> <paused xmlns="http://jabber.org/protocol/chatstates" /> </message> >>> msg['chat_state'] 'paused' >>> del msg['chat_state'] >>> msg <message />
2011-02-14Merge branch 'develop' into rosterLance Stout
Conflicts: sleekxmpp/clientxmpp.py
2011-02-11XMPPError exceptions can keep a stanza's contents.Lance Stout
This allows exceptions to include the original content of a stanza in the error response by including the parameter clear=False when raising the exception.
2011-02-08Update XEP-0060 test.Lance Stout
2011-02-07Fixed failing tests from new XEP-0009 pluginLance Stout
2011-02-05fixed mergeNathan Fritz
2011-02-02Merge branch 'develop' into rosterLance Stout
Conflicts: sleekxmpp/basexmpp.py
2011-01-19Fix tests for Nick stanza.Lance Stout
2011-01-13Introduced new XEP-0009 into develop.Dann Martens
2011-01-09Merge branch 'develop' into rosterLance Stout
2011-01-08Update the XEP-0092 plugin to the new style.Lance Stout
2011-01-08Add support for XEP-0059 to XEP-0030 plugin.Lance Stout
2011-01-08Added new XEP-0059 plugin.Lance Stout
Contributed by Erik Reuterborg Larsson (who).
2011-01-05Merge branch 'develop' into rosterLance Stout
2010-12-28Make the new XEP-30 plugin retain older API signatures.Lance Stout
2010-12-21Merge branch 'develop' into rosterLance Stout
2010-12-17Make tests pass for catching exceptions.Lance Stout
May now use sys.excepthook to catch exceptions from threaded handlers.
2010-12-13Merge branch 'develop' into rosterLance Stout
Conflicts: sleekxmpp/basexmpp.py
2010-12-09First pass at a new XEP-0030 plugin.Lance Stout
Now with dynamic node handling goodness. Some things are not quite working yet, in particular: set_items set_info set_identities set_features And still need more unit tests to round things out.
2010-12-08Fix xml:lang tostring test.Lance Stout
2010-12-07Add support for using xml:lang values.Lance Stout
Support is only for adding literal XML content to stanzas. Full support for things like multiple message bodies with different xml:lang values is still in the works.
2010-12-07Added option for iq.send to accept a callhandler.Lance Stout
The callback will be a stream level handler, and will not execute in its own thread. If you must have a thread, have the callback function raise a custom event, which can be processed by another event handler, which may run in an individual thread, like so: def handle_reply(self, iq): self.event('custom_event', iq) def do_long_operation_in_thread(self, iq): ... self.add_event_handler('custom_event', self.do_long_operation_in_thread) ...take out already prepared iq stanza... iq.send(callback=self.handle_reply)
2010-11-18Adding stream tests for XEP-0030.Lance Stout
Fixed some errors when responding to disco requests.
2010-11-18Merge branch 'develop' of github.com:fritzy/SleekXMPP into rosterLance Stout
2010-11-17Fixed some live stream test errors.Lance Stout
Added test demonstrating using multiple stream clients in a single test.
2010-11-17Merge branch 'develop' into rosterLance Stout
2010-11-17Make live stream tests work better.Lance Stout
SleekTest can now use matchers when checking stanzas, using the method parameter for self.check(), self.recv(), and self.send(): method='exact' - Same behavior as before 'xpath' - Use xpath matcher 'id' - Use ID matcher 'mask' - Use XML mask matcher 'stanzapath' - Use StanzaPath matcher recv_feature and send_feature only accept 'exact' and 'mask' for now.
2010-11-17Remove extraneous files.Lance Stout
2010-11-17Merge branch 'roster' of github.com:fritzy/SleekXMPP into rosterLance Stout
Conflicts: sleekxmpp/basexmpp.py sleekxmpp/roster.py sleekxmpp/test/sleektest.py tests/test_stream_presence.py tests/test_stream_roster.py
2010-11-17More cleanup.Lance Stout
2010-11-17Cleaned up names.Lance Stout
2010-11-17First pass at integrating the new roster manager.Lance Stout
2010-11-05Simplified SleekTest.Lance Stout
* check_stanza does not require stanza_class parameter. Introspection! * check_message, check_iq, and check_presence removed -- use check instead. * stream_send_stanza, stream_send_message, stream_send_iq, and stream_send_presence removed -- use send instead. * Use recv instead of recv_message, recv_presence, etc. * check_jid instead of check_JID * stream_start may accept multi=True to return a new SleekTest instance for testing multiple streams at once.
2010-10-27Cleaned up names.Lance Stout
2010-10-26First pass at integrating the new roster manager.Lance Stout
2010-10-25Made exceptions work.sleek-1.0-Beta21.0-Beta2Lance Stout
Raising an XMPPError exception from an event handler now works, even if from a threaded handler. Added stream tests to verify. We should start using XMPPError, it really makes things simple!
2010-10-25Added more presence stream tests.Lance Stout
Tests auto_authorize=False, and got_online.