Commit graph

330 commits

Author SHA1 Message Date
Lance Stout
d979b5f2b9 Add caching support to xep_0030.
New plugin configuration options:

    use_cache    - Enable caching disco info results. Defaults to True
    wrap_results - Always return disco results in an Iq stanza. Defaults
                   to False

Node handler changes:

    Handlers now take four arguments: jid, node, ifrom, data

    Most older style handlers will still work, depending on if they
    raise a TypeError for incorrect number of arguments. Handlers that
    used *args may not work.

New get_info options:

    cached - Passing cached=True to get_info() will attempt to load
             results from the cache. If nothing is found, a query
             will be sent as normal. If set to False, the cache
             will be skipped, even if it contains results.

New method:

    supports() - Given a JID/node pair and a feature, return True
                 if the feature is supported, False if not, and
                 None if there was a timeout. By default, the search
                 will use the cache.
2011-12-28 10:16:31 -05:00
Lance Stout
2f2ebb37e4 Merge branch 'develop' into develop-1.1 2011-12-27 18:05:42 -05:00
Correl Roush
e928b9c434 XEP-0009: Updated tests to work in python 3 2011-12-20 21:19:51 -05:00
Correl Roush
2b3d11a7a5 XEP-0009: Added value conversion unit tests
Added tests for bidirectional conversion of all XML-RPC data types
2011-12-20 02:01:34 -05:00
Lance Stout
45ed68006f Add tests for filters. 2011-12-13 20:05:31 -08:00
Lance Stout
62e6d6fb4c Fix iterable substanzas when added as normal plugin.
If an iterable plugin was an enabled, it wasn't added to
the iterables list.
2011-12-11 17:04:58 -08:00
Lance Stout
2d610dfdc8 Fix stream handler test for multiple handlers to exist properly. 2011-11-21 22:03:43 -08:00
Lance Stout
f9d0b55ca3 Add unit test for copying stanzas when passed to events. 2011-11-19 18:43:38 -08:00
Lance Stout
d4c1ff5309 Also fire changed_status when the status text changes for a resource. 2011-11-18 13:57:41 -08:00
Lance Stout
22868c3924 Fix changed_status event
Once again only fires when a resource's presence show value changes.
2011-11-18 13:39:02 -08:00
Lance Stout
43c4d23896 Explicitly test for inequality in JIDs.
Fixes issue #113
2011-11-14 09:15:43 -08:00
Lance Stout
262da78ca7 Fix del_event_handler for Python3 (different semantics for filter()).
Fixes issue #103
2011-09-23 12:03:49 -04:00
Lance Stout
982c2d9b83 Add tests for pubsub error stanzas 2011-09-01 15:26:54 -07:00
Lance Stout
7e5e9542e9 Add support for notify attribute when retracting an item. 2011-09-01 13:36:11 -07:00
Lance Stout
d7fc2aaa9c Add ability to get global/node default subscription options. 2011-09-01 13:25:35 -07:00
Lance Stout
462b375c8f Owners can modify subscriptions/affiliations. With tests.
94% coverage for the main pubsub plugin! (91% including stanzas)
2011-09-01 12:09:24 -07:00
Lance Stout
afbd506cfc Users can retrieve their affiliations now, with tests. 2011-09-01 11:30:55 -07:00
Lance Stout
ec01e45ed1 Add ability for a user to get retrieve subscriptions, with tests. 2011-09-01 11:19:25 -07:00
Lance Stout
993829b23f Add tests for pubsub subscription options. 2011-09-01 10:44:14 -07:00
Lance Stout
002257b820 Add tests for retrieving pubsub items. 2011-09-01 09:27:10 -07:00
Lance Stout
0af35c2224 Fix memory reference bugs. 2011-09-01 00:50:45 -07:00
Lance Stout
76bc0a2ba6 XEP-0060 v1.13 dictates publishing/retracting one item at a time. 2011-08-31 23:48:22 -07:00
Lance Stout
d2dc4824ee Simplify pubsub tests.
We don't really care about empty responses, so let's use block=False.
2011-08-31 21:52:17 -07:00
Lance Stout
3f9ca0366b Add test for purging a pubsub node. 2011-08-31 21:09:25 -07:00
Lance Stout
b68785e19e Retract stanzas are behaving oddly when using stanza values. 2011-08-31 16:03:32 -07:00
Lance Stout
a1bbb719e1 Test publishing multiple items, and with options. 2011-08-31 15:04:46 -07:00
Lance Stout
46f23f7348 Test publishng an item with options. 2011-08-31 14:55:37 -07:00
Lance Stout
09252baa71 Test publishing a single item. 2011-08-31 14:31:20 -07:00
Lance Stout
3623a7a16a More pubsub unit tests! 2011-08-31 14:05:29 -07:00
Lance Stout
2500a0649b Fix requesting pubsub node configuration, and add tests.
- <default /> doesn't have a type attribute in the XEP
- <configure /> isn't used anymore for requesting default configuration
2011-08-31 10:43:33 -07:00
Lance Stout
730c3fada0 Add tests for pubsub unsubscribe. 2011-08-30 23:18:13 -07:00
Lance Stout
e0a1c477d0 Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-30 23:03:51 -07:00
Nathan Fritz
b70565720f fixed test further... but now I have an out of order problem 2011-08-30 23:03:04 -07:00
Lance Stout
6b7fde10d3 Test pubsub subscribe. 2011-08-30 22:27:02 -07:00
Lance Stout
13fdab0139 Test and fix XEP-0060 delete_node() 2011-08-30 21:57:11 -07:00
Lance Stout
d12949ff1c Fix typos in XEP-0060, start of docs and tests. 2011-08-26 12:14:57 -07:00
Lance Stout
82546d776d Fix tests in Python3. 2011-08-25 00:21:53 -07:00
Lance Stout
ede59ab40e Clean and get setup.py working once and for all.
Fixes:
    README.rst now included
    Double line spacing removed from long_description
    Source package now includes tests, examples, etc using Manifest.in
    README.rst typos fixed
    Added README.rst section on installing dnspython for Python3
    Version bumped to RC2
    Version is now taken from sleekxmpp.version.__version__ without
        having to pull in the entire library
    Added 'test' command for setup.py
    Simplified testall.py
    Docs build cleanly from source package after installation
2011-08-24 22:09:02 -07:00
Lance Stout
017d7ec62b Add tests for setting a form's type to 'submit' or 'cancel'.
Form fields now remember their current type if the type is deleted. This
allows for fields to properly format their values if set after the form
has been changed to the 'submit' type.
2011-08-13 01:28:18 -07:00
Lance Stout
c26b716164 Update XEP-0050 to use new IQ exceptions.
IqError is now caught and forwarded to the command error handler referenced
in the session.

Errors are now caught and processed by the session's error handler
whether or not the results Iq stanza includes the <command> substanza.

Added the option for blocking command calls. The blocking option is set
during start_command with block=True. Subsequent command flow methods use
session['block'] to determine their blocking behaviour.

If you use blocking commands, then you will need to wrap your command calls
in a try/except block for IqTimeout exceptions.
2011-08-13 00:10:06 -07:00
Lance Stout
484efff156 Merge branch 'develop' into roster
Conflicts:
	setup.py
	sleekxmpp/clientxmpp.py
2011-08-12 16:47:58 -07:00
Nathan Fritz
8f1d0e7a79 Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-12 16:36:03 -07:00
Nathan Fritz
bd8c110f00 Merge branch 'exceptions' into develop 2011-08-12 16:35:15 -07:00
Lance Stout
9b7ed73f95 Reorganize XEP-0004.
Changes:
    May now use underscored method names
    form.field is replaced by form['fields']
    form.get_fields no longer accepts use_dict parameter, it always
        returns an OrderedDict now
    form.set_fields will accept either an OrderedDict, or a list
        of (var, dict) tuples as before.
    Setting the form type to 'submit' will remove extra meta data
        from the form fields, leaving just the 'var' and 'value'
    Setting the form type to 'cancel' will remove all fields.
2011-08-11 21:59:55 -07:00
Lance Stout
89cffd43f4 Merge branch 'develop' into roster
Conflicts:
	setup.py
2011-08-04 11:52:17 -07:00
Nathan Fritz
9ffdba8643 the great xep_0060 re-organization in preperation for rewrite 2011-08-03 23:56:24 -07:00
Lance Stout
3918ddb075 Merge branch 'develop' into stream_features 2011-08-03 17:02:33 -07:00
Lance Stout
d7fe724145 Merge branch 'develop' into exceptions 2011-07-27 19:36:04 -07:00
Lance Stout
ad978700fc Merge branch 'develop' into roster 2011-07-27 19:35:42 -07:00
Lance Stout
ccc6ab1281 Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-07-05 21:30:16 -07:00
Lance Stout
712da4c46e Add test to check that presence events are firing. 2011-07-05 21:29:31 -07:00
Lance Stout
b2d42b1d6c Test no longer applies to latest version of XEP-0066. 2011-07-05 11:18:46 -07:00
Lance Stout
20df6348a4 Merge branch 'develop' into exceptions 2011-07-03 00:39:14 -07:00
Lance Stout
48fb7006f7 Merge branch 'develop' into roster 2011-07-03 00:39:02 -07:00
Lance Stout
9a6eb333e6 Merge branch 'develop' into stream_features 2011-07-03 00:38:22 -07:00
Lance Stout
086bf89d69 Added XEP-0066: Out-of-Band Data 2011-07-03 00:36:36 -07:00
Lance Stout
04def6d925 Merge branch 'develop' into stream_features 2011-07-01 15:19:37 -07:00
Lance Stout
7057984831 Merge branch 'develop' into roster 2011-07-01 15:19:05 -07:00
Lance Stout
2a2ac73845 So using sys.excepthook to catch errors only works once.
The error bubbles through the event processing loop, breaking it and
hanging the application.

Instead, there is now a .exception(e) method on XMLStream which may
be overridden or reassigned that will receive all unhandled exceptions
(read: not XMPPError) from event and stream handlers.
2011-07-01 15:18:10 -07:00
Lance Stout
fa716457a5 Merge branch 'develop' into stream_features 2011-06-20 16:27:55 -07:00
Lance Stout
847510c6b5 Merge branch 'develop' into exceptions 2011-06-20 16:27:39 -07:00
Lance Stout
774e0f2022 Merge branch 'develop' into roster 2011-06-20 16:27:25 -07:00
Lance Stout
d8d9e8df16 Fix stanza clobbering when replying to errors.
If a stanza handler raised an exception, the exception was processed
and replied by the modified stanza, not a stanza with the original
content.

A copy is now made before handler processing, and if an exception occurs
it is the copy that processes the exception using the original content.
2011-06-20 16:25:56 -07:00
Lance Stout
29d775e675 Integrate roster with BaseXMPP.
Last sent stanzas are saved regardless of if the roster is used
directly or self.send_presence
2011-06-16 16:03:31 -07:00
Lance Stout
8aa4396e44 Begin experimental use of exceptions.
Provides IqTimeout and IqError which are raised when an Iq response
does not arrive in time, or it arrives with type='error'.
2011-06-01 15:17:22 -07:00
Lance Stout
83a73ac9b7 Merge branch 'develop' into stream_features
Conflicts:
	sleekxmpp/clientxmpp.py
2011-05-31 11:05:54 -07:00
Lance Stout
5ed27bf5f6 Merge branch 'develop' into roster 2011-05-31 10:59:14 -07:00
Lance Stout
384e1a92b7 Added support for testind disconnect errors. 2011-05-27 11:01:30 -07:00
Lance Stout
ccb0eeefbd Merge branch 'develop' into stream_features 2011-05-25 15:53:33 -07:00
Lance Stout
62bdaab7c7 Merge branch 'develop' into roster 2011-05-25 15:53:24 -07:00
Lance Stout
ec9aed5b75 Fix test for get_roster().
Python2.6 has issues passing a Unicode string as a keyword name.
2011-05-25 15:52:42 -07:00
Lance Stout
9851a2a057 Merge branch 'develop' into stream_features 2011-05-20 21:41:44 -04:00
Lance Stout
bb2bc64d15 Merge branch 'develop' into roster 2011-05-20 21:40:37 -04:00
Lance Stout
7152d93dd0 Fix test timeout issue.
A better method than using time.sleep is needed.
Maybe use queue.task_done to detect when event processing
has ended? Research time!
2011-05-20 21:38:43 -04:00
Lance Stout
baa1eaf73a Fix test for Python3.
Issue of dict_keys vs list data types.
2011-05-20 21:36:09 -04:00
Lance Stout
4bb226147a Make roster test a little more robust. 2011-05-20 21:19:27 -04:00
Lance Stout
4d3593ac86 Merge branch 'develop' into roster
Conflicts:
	tests/test_stream_roster.py
2011-05-20 21:12:53 -04:00
Lance Stout
c49a8e9114 Save progress 2011-05-20 17:42:40 -04:00
Lance Stout
6b274a2543 Fix double roster entry issue with Unicode.
JIDs with Unicode values were being encoded by the JID class
instead of leaving them as just Unicode strings.

It may still be a good idea to use

    from __future__ import unicode_literals

pretty much everywhere though.

Fixes issue #88.
2011-05-20 16:48:13 -04:00
Lance Stout
e2de82ac8d Merge branch 'develop' into stream_features
Conflicts:
	sleekxmpp/clientxmpp.py
2011-05-20 13:26:21 -04:00
Lance Stout
e3b14bc5a9 Merge branch 'develop' into roster
Conflicts:
	sleekxmpp/clientxmpp.py
	tests/test_stream_roster.py
2011-05-20 13:23:48 -04:00
Lance Stout
9f1648328f Resolve timeout errors for get_roster.
See issue #89

Using get_roster will now return the same types of values as
Iq.send. If a timeout occurs, then the event 'roster_timeout'
will be fired. A successful call to get_roster will also
raise the 'roster_received' event.

To ensure that the get_roster call was successful, here
is a pattern to follow:

    def __init__(self, ...):
        ...
        self.add_event_handler('session_start', self.session_start)
        self.add_event_handler('roster_timeout', self.roster_timeout)
        self.add_event_handler('roster_received', self.roster_received)

    def session_start(self, e):
        self.send_presence()
        self.get_roster()

    def roster_timeout(self, e):
        # Optionally increase the timeout period
        self.get_roster(timeout=self.response_timeout * 2)

    def roster_received(self, iq):
        # Do stuff, roster has been initialized.
        ...
2011-05-20 12:56:00 -04:00
Lance Stout
8e9b3d0760 Ensure that the XEP-0086 plugin is loaded.
Since the XEP-0086 plugin auto adds error code values,
it must be reliably loaded or unloaded when certain tests
are run so that stanzas may be matched. In this case, we
ensure that the plugin is used.
2011-05-13 15:28:47 -04:00
Lance Stout
b60c51ef13 Merge branch 'develop' into roster 2011-04-08 16:52:20 -04:00
Lance Stout
f02b0564e0 Update tests to reflect XEP-0086 correcting error codes. 2011-04-08 16:51:24 -04:00
Lance Stout
f125c11a81 Merge branch 'develop' into stream_features 2011-03-24 13:15:09 -04:00
Lance Stout
77601f7262 Merge branch 'develop' into roster 2011-03-24 13:15:00 -04:00
Lance Stout
d94811d81d Added new implementation for XEP-0086. 2011-03-24 13:14:26 -04:00
Lance Stout
6d45971411 Allow a stanza plugin to override a parent's interfaces.
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-24 12:25:17 -04:00
Lance Stout
bf2f2782b7 Merge branch 'develop' into stream_features 2011-03-24 09:36:35 -04:00
Lance Stout
d9be51b2ef Merge branch 'develop' into roster 2011-03-24 09:36:26 -04:00
Lance Stout
a3d111be12 Added new XEP-0050 implementation.
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-24 09:35:36 -04:00
Lance Stout
694673b9bd Merge branch 'develop' into stream_features 2011-03-23 10:01:21 -04:00
Lance Stout
393259c24b Merge branch 'develop' into roster 2011-03-23 10:01:10 -04:00
Lance Stout
833f95b53a Cleaned XEP-0249 plugin, added tests. 2011-03-23 10:00:32 -04:00
Lance Stout
306bdd8021 Merge branch 'develop' into stream_features 2011-03-22 20:48:28 -04:00
Lance Stout
756c4c032f Merge branch 'develop' into roster 2011-03-22 20:48:09 -04:00
Lance Stout
4b1fadde4b Updated XEP-0128 plugin to work with the new XEP-0030 plugin.
Required fixing a few bugs in StanzaBase related to iterable
substanzas.
2011-03-22 20:42:43 -04:00
Lance Stout
f2c99798a6 Merge branch 'develop' into stream_features 2011-03-18 15:51:44 -04:00
Lance Stout
42c8f6ae87 Merge branch 'develop' into roster 2011-02-24 16:19:45 -05:00
Lance Stout
1a81b2f464 Add tests for XEP-0085, fix some bugs. 2011-02-24 14:15:02 -05:00
Lance Stout
77251452c1 Updated the XEP-0085 plugin.
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-24 12:10:29 -05:00
Lance Stout
d5b3a52827 Merge branch 'develop' into stream_features
Conflicts:
	sleekxmpp/xmlstream/stanzabase.py
2011-02-14 16:26:23 -05:00
Lance Stout
a278f79bdb Merge branch 'develop' into roster
Conflicts:
	sleekxmpp/clientxmpp.py
2011-02-14 16:18:44 -05:00
Lance Stout
0d32638379 XMPPError exceptions can keep a stanza's contents.
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-11 15:20:26 -05:00
Lance Stout
30da68f47b Update XEP-0060 test. 2011-02-08 21:09:49 -05:00
Lance Stout
aa1996eba6 Fixed failing tests from new XEP-0009 plugin 2011-02-07 10:18:15 -05:00
Nathan Fritz
683f717cf7 fixed merge 2011-02-05 04:54:52 -08:00
Lance Stout
de6170a13d Merge branch 'develop' into roster
Conflicts:
	sleekxmpp/basexmpp.py
2011-02-02 09:13:22 -05:00
Lance Stout
bd9bf3f1c7 Update tostring methods.
Will now always show top-level namespace, unless it is the same
as the stream's default namespace. Also added the XMPP stream
namespace to the namespace map as 'stream'.
2011-01-27 18:05:05 -05:00
Lance Stout
f7e7bf601e Fix tests for Nick stanza. 2011-01-19 19:03:02 -05:00
Dann Martens
3a12cdbd13 Introduced new XEP-0009 into develop. 2011-01-13 08:40:53 +01:00
Lance Stout
23e499998f Merge branch 'develop' into roster 2011-01-09 10:04:09 -05:00
Lance Stout
2076d506b4 Update the XEP-0092 plugin to the new style. 2011-01-08 22:38:13 -05:00
Lance Stout
7c7fa0f008 Add support for XEP-0059 to XEP-0030 plugin. 2011-01-08 11:19:31 -05:00
Lance Stout
a8e3657487 Added new XEP-0059 plugin.
Contributed by Erik Reuterborg Larsson (who).
2011-01-08 10:58:47 -05:00
Lance Stout
c156a4f723 Merge branch 'develop' into roster 2011-01-05 16:53:33 -05:00
Lance Stout
8749f5e09b Make the new XEP-30 plugin retain older API signatures. 2010-12-28 15:43:00 -05:00
Lance Stout
3657bf6636 Merge branch 'develop' into roster 2010-12-21 11:33:40 -05:00
Lance Stout
34c374a1e1 Make tests pass for catching exceptions.
May now use sys.excepthook to catch exceptions
from threaded handlers.
2010-12-17 13:11:03 -05:00
Lance Stout
c16913c999 Merge branch 'develop' into roster
Conflicts:
	sleekxmpp/basexmpp.py
2010-12-13 14:36:53 -05:00
Lance Stout
f4451fe6b7 First pass at a new XEP-0030 plugin.
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-09 18:57:27 -05:00
Lance Stout
8d4e77aba6 Fix xml:lang tostring test. 2010-12-08 00:18:04 -05:00
Lance Stout
f474d378ef Add support for using xml:lang values.
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-07 23:07:40 -05:00
Lance Stout
5f2fc67c40 Added option for iq.send to accept a callhandler.
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-12-07 17:19:39 -05:00
Lance Stout
ab25301953 Adding stream tests for XEP-0030.
Fixed some errors when responding to disco requests.
2010-11-18 15:50:45 -05:00
Lance Stout
58b95e4ae4 Merge branch 'develop' of github.com:fritzy/SleekXMPP into roster 2010-11-18 00:44:51 -05:00
Lance Stout
ea48bb5ac5 Fixed some live stream test errors.
Added test demonstrating using multiple stream clients
in a single test.
2010-11-17 15:45:16 -05:00
Lance Stout
debf909359 Merge branch 'develop' into roster 2010-11-17 14:33:09 -05:00
Lance Stout
b8114b25ed Make live stream tests work better.
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-17 13:43:15 -05:00
Lance Stout
d2aca3e7e0 Remove extraneous files. 2010-11-17 02:04:36 -05:00
Lance Stout
26aca2b789 Merge branch 'roster' of github.com:fritzy/SleekXMPP into roster
Conflicts:
	sleekxmpp/basexmpp.py
	sleekxmpp/roster.py
	sleekxmpp/test/sleektest.py
	tests/test_stream_presence.py
	tests/test_stream_roster.py
2010-11-17 02:01:12 -05:00
Lance Stout
5424ede413 More cleanup. 2010-11-17 01:54:30 -05:00
Lance Stout
69d430dd75 Cleaned up names. 2010-11-17 01:49:51 -05:00
Lance Stout
673545c7e4 First pass at integrating the new roster manager. 2010-11-17 01:49:19 -05:00
Lance Stout
d0c506f930 Simplified SleekTest.
* 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-11-05 21:18:48 -04:00
Lance Stout
c6ed4b8a1d Cleaned up names. 2010-10-27 08:09:50 -04:00
Lance Stout
65aa6573df First pass at integrating the new roster manager. 2010-10-26 23:47:17 -04:00
Lance Stout
5bdcd9ef9d Made exceptions work.
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-25 15:09:56 -04:00
Lance Stout
2eff35cc7a Added more presence stream tests.
Tests auto_authorize=False, and got_online.
2010-10-25 13:21:00 -04:00
Lance Stout
ac330b5c6c Fixed bug in presence subscription handling.
Subscription requests and responses were not setting the correct 'to'
attribute.
2010-10-25 12:52:32 -04:00
Lance Stout
46ffa8e9fe Added stream tests for presence events.
First batch of tests, currently focuses on the got_offline event.
2010-10-24 19:57:07 -04:00
Lance Stout
03847497cc Added test for error stanzas. 2010-10-24 19:56:42 -04:00
Lance Stout
185d7cf28e More JID unit tests.
sleekxmpp.xmlstream.jid now has 100% coverage!
2010-10-24 19:06:54 -04:00
Lance Stout
9e3d506651 Fixed resource bug in JIDs.
JIDs without resources will return '' instead of the bare JID.

Cleaned up JID tests, and added check_JID to SleekTest.
2010-10-24 18:22:41 -04:00
Lance Stout
d528884723 Added stream tests for rosters. 2010-10-24 12:53:14 -04:00
Lance Stout
8f55704928 Fixed mixed text and elements bug in tostring.
XML of the form <a>foo <b>bar</b> baz</a> was outputted as
<a>foo <b>bar</b> baz baz</a>.

Includes unit test.
2010-10-21 16:21:28 -04:00
Lance Stout
4375ac7d8b Underscore names by default.
Stanza objects now accept the use of underscored names.

The CamelCase versions are still available for backwards compatibility,
but are discouraged.

The property stanza.values now maps to the old getStanzaValues and
setStanzaValues, in addition to _set_stanza_values and
_get_stanza_values.
2010-10-17 22:04:42 -04:00
Lance Stout
b0e036d03c Added example live stream test.
Run using:
python tests/live_test.py
2010-10-07 19:46:40 -04:00
Lance Stout
e02ffe8547 Corrected test errors.
There was a bug in the XML compare method.
2010-10-07 19:42:28 -04:00