XEP-0030: API changes

- ``supports``, ``has_identity``, ``get_info``, ``get_items`` are now coroutines
- ``set_info````set_items``, ``del_items``, ``add_item``, ``add_identity``,
  ``del_identity``, ``set_identities``, ``del_identities``, ``add_feature``,
  ``del_feature``, ``set_feature``, ``set_features``, ``del_features``
  now return a Future

also fix has_identity and supports which have been broken in forever
This commit is contained in:
mathieui
2021-02-14 12:06:05 +01:00
parent 7772e26a8c
commit 13de36baa1
3 changed files with 125 additions and 71 deletions

View File

@@ -1,5 +1,5 @@
import asyncio
import time
import threading
import unittest
from slixmpp.test import SlixTest
@@ -288,7 +288,9 @@ class TestStreamDisco(SlixTest):
self.xmpp.add_event_handler('disco_info', handle_disco_info)
self.xmpp['xep_0030'].get_info('user@localhost', 'foo')
self.xmpp.wrap(self.xmpp['xep_0030'].get_info('user@localhost', 'foo'))
self.wait_()
self.send("""
<iq type="get" to="user@localhost" id="1">
@@ -483,7 +485,8 @@ class TestStreamDisco(SlixTest):
self.xmpp.add_event_handler('disco_items', handle_disco_items)
self.xmpp['xep_0030'].get_items('user@localhost', 'foo')
self.xmpp.wrap(self.xmpp['xep_0030'].get_items('user@localhost', 'foo'))
self.wait_()
self.send("""
<iq type="get" to="user@localhost" id="1">