Updated tests to use a relative import for SleekTest to please Python3.
Fixed some tabs/spaces issues.
This commit is contained in:
parent
c54466596f
commit
58f77d898f
13 changed files with 337 additions and 336 deletions
|
@ -1,110 +1,111 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
import sleekxmpp.plugins.xep_0033 as xep_0033
|
||||
|
||||
|
||||
class TestAddresses(SleekTest):
|
||||
|
||||
def setUp(self):
|
||||
registerStanzaPlugin(Message, xep_0033.Addresses)
|
||||
def setUp(self):
|
||||
registerStanzaPlugin(Message, xep_0033.Addresses)
|
||||
|
||||
def testAddAddress(self):
|
||||
"""Testing adding extended stanza address."""
|
||||
msg = self.Message()
|
||||
msg['addresses'].addAddress(atype='to', jid='to@header1.org')
|
||||
self.checkMessage(msg, """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address jid="to@header1.org" type="to" />
|
||||
</addresses>
|
||||
</message>
|
||||
""")
|
||||
def testAddAddress(self):
|
||||
"""Testing adding extended stanza address."""
|
||||
msg = self.Message()
|
||||
msg['addresses'].addAddress(atype='to', jid='to@header1.org')
|
||||
self.checkMessage(msg, """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address jid="to@header1.org" type="to" />
|
||||
</addresses>
|
||||
</message>
|
||||
""")
|
||||
|
||||
msg = self.Message()
|
||||
msg['addresses'].addAddress(atype='replyto',
|
||||
jid='replyto@header1.org',
|
||||
desc='Reply address')
|
||||
self.checkMessage(msg, """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address jid="replyto@header1.org" type="replyto" desc="Reply address" />
|
||||
</addresses>
|
||||
</message>
|
||||
""")
|
||||
msg = self.Message()
|
||||
msg['addresses'].addAddress(atype='replyto',
|
||||
jid='replyto@header1.org',
|
||||
desc='Reply address')
|
||||
self.checkMessage(msg, """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address jid="replyto@header1.org" type="replyto" desc="Reply address" />
|
||||
</addresses>
|
||||
</message>
|
||||
""")
|
||||
|
||||
def testAddAddresses(self):
|
||||
"""Testing adding multiple extended stanza addresses."""
|
||||
def testAddAddresses(self):
|
||||
"""Testing adding multiple extended stanza addresses."""
|
||||
|
||||
xmlstring = """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address jid="replyto@header1.org" type="replyto" desc="Reply address" />
|
||||
<address jid="cc@header2.org" type="cc" />
|
||||
<address jid="bcc@header2.org" type="bcc" />
|
||||
</addresses>
|
||||
</message>
|
||||
"""
|
||||
xmlstring = """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address jid="replyto@header1.org" type="replyto" desc="Reply address" />
|
||||
<address jid="cc@header2.org" type="cc" />
|
||||
<address jid="bcc@header2.org" type="bcc" />
|
||||
</addresses>
|
||||
</message>
|
||||
"""
|
||||
|
||||
msg = self.Message()
|
||||
msg['addresses'].setAddresses([{'type':'replyto',
|
||||
'jid':'replyto@header1.org',
|
||||
'desc':'Reply address'},
|
||||
{'type':'cc',
|
||||
'jid':'cc@header2.org'},
|
||||
{'type':'bcc',
|
||||
'jid':'bcc@header2.org'}])
|
||||
self.checkMessage(msg, xmlstring)
|
||||
msg = self.Message()
|
||||
msg['addresses'].setAddresses([
|
||||
{'type':'replyto',
|
||||
'jid':'replyto@header1.org',
|
||||
'desc':'Reply address'},
|
||||
{'type':'cc',
|
||||
'jid':'cc@header2.org'},
|
||||
{'type':'bcc',
|
||||
'jid':'bcc@header2.org'}])
|
||||
self.checkMessage(msg, xmlstring)
|
||||
|
||||
msg = self.Message()
|
||||
msg['addresses']['replyto'] = [{'jid':'replyto@header1.org',
|
||||
msg = self.Message()
|
||||
msg['addresses']['replyto'] = [{'jid':'replyto@header1.org',
|
||||
'desc':'Reply address'}]
|
||||
msg['addresses']['cc'] = [{'jid':'cc@header2.org'}]
|
||||
msg['addresses']['bcc'] = [{'jid':'bcc@header2.org'}]
|
||||
self.checkMessage(msg, xmlstring)
|
||||
msg['addresses']['cc'] = [{'jid':'cc@header2.org'}]
|
||||
msg['addresses']['bcc'] = [{'jid':'bcc@header2.org'}]
|
||||
self.checkMessage(msg, xmlstring)
|
||||
|
||||
def testAddURI(self):
|
||||
"""Testing adding URI attribute to extended stanza address."""
|
||||
def testAddURI(self):
|
||||
"""Testing adding URI attribute to extended stanza address."""
|
||||
|
||||
msg = self.Message()
|
||||
addr = msg['addresses'].addAddress(atype='to',
|
||||
jid='to@header1.org',
|
||||
node='foo')
|
||||
self.checkMessage(msg, """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address node="foo" jid="to@header1.org" type="to" />
|
||||
</addresses>
|
||||
</message>
|
||||
""")
|
||||
msg = self.Message()
|
||||
addr = msg['addresses'].addAddress(atype='to',
|
||||
jid='to@header1.org',
|
||||
node='foo')
|
||||
self.checkMessage(msg, """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address node="foo" jid="to@header1.org" type="to" />
|
||||
</addresses>
|
||||
</message>
|
||||
""")
|
||||
|
||||
addr['uri'] = 'mailto:to@header2.org'
|
||||
self.checkMessage(msg, """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address type="to" uri="mailto:to@header2.org" />
|
||||
</addresses>
|
||||
</message>
|
||||
""")
|
||||
addr['uri'] = 'mailto:to@header2.org'
|
||||
self.checkMessage(msg, """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address type="to" uri="mailto:to@header2.org" />
|
||||
</addresses>
|
||||
</message>
|
||||
""")
|
||||
|
||||
def testDelivered(self):
|
||||
"""Testing delivered attribute of extended stanza addresses."""
|
||||
def testDelivered(self):
|
||||
"""Testing delivered attribute of extended stanza addresses."""
|
||||
|
||||
xmlstring = """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address %s jid="to@header1.org" type="to" />
|
||||
</addresses>
|
||||
</message>
|
||||
"""
|
||||
xmlstring = """
|
||||
<message>
|
||||
<addresses xmlns="http://jabber.org/protocol/address">
|
||||
<address %s jid="to@header1.org" type="to" />
|
||||
</addresses>
|
||||
</message>
|
||||
"""
|
||||
|
||||
msg = self.Message()
|
||||
addr = msg['addresses'].addAddress(jid='to@header1.org', atype='to')
|
||||
self.checkMessage(msg, xmlstring % '')
|
||||
msg = self.Message()
|
||||
addr = msg['addresses'].addAddress(jid='to@header1.org', atype='to')
|
||||
self.checkMessage(msg, xmlstring % '')
|
||||
|
||||
addr['delivered'] = True
|
||||
self.checkMessage(msg, xmlstring % 'delivered="true"')
|
||||
addr['delivered'] = True
|
||||
self.checkMessage(msg, xmlstring % 'delivered="true"')
|
||||
|
||||
addr['delivered'] = False
|
||||
self.checkMessage(msg, xmlstring % '')
|
||||
addr['delivered'] = False
|
||||
self.checkMessage(msg, xmlstring % '')
|
||||
|
||||
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(TestAddresses)
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
import sleekxmpp.plugins.xep_0085 as xep_0085
|
||||
|
||||
class TestChatStates(SleekTest):
|
||||
|
||||
def setUp(self):
|
||||
registerStanzaPlugin(Message, xep_0085.Active)
|
||||
registerStanzaPlugin(Message, xep_0085.Composing)
|
||||
registerStanzaPlugin(Message, xep_0085.Gone)
|
||||
registerStanzaPlugin(Message, xep_0085.Inactive)
|
||||
registerStanzaPlugin(Message, xep_0085.Paused)
|
||||
|
||||
def testCreateChatState(self):
|
||||
"""Testing creating chat states."""
|
||||
|
||||
xmlstring = """
|
||||
<message>
|
||||
<%s xmlns="http://jabber.org/protocol/chatstates" />
|
||||
</message>
|
||||
"""
|
||||
def setUp(self):
|
||||
registerStanzaPlugin(Message, xep_0085.Active)
|
||||
registerStanzaPlugin(Message, xep_0085.Composing)
|
||||
registerStanzaPlugin(Message, xep_0085.Gone)
|
||||
registerStanzaPlugin(Message, xep_0085.Inactive)
|
||||
registerStanzaPlugin(Message, xep_0085.Paused)
|
||||
|
||||
msg = self.Message()
|
||||
msg['chat_state'].active()
|
||||
self.checkMessage(msg, xmlstring % 'active',
|
||||
use_values=False)
|
||||
def testCreateChatState(self):
|
||||
"""Testing creating chat states."""
|
||||
|
||||
msg['chat_state'].composing()
|
||||
self.checkMessage(msg, xmlstring % 'composing',
|
||||
use_values=False)
|
||||
xmlstring = """
|
||||
<message>
|
||||
<%s xmlns="http://jabber.org/protocol/chatstates" />
|
||||
</message>
|
||||
"""
|
||||
|
||||
msg = self.Message()
|
||||
msg['chat_state'].active()
|
||||
self.checkMessage(msg, xmlstring % 'active',
|
||||
use_values=False)
|
||||
|
||||
msg['chat_state'].composing()
|
||||
self.checkMessage(msg, xmlstring % 'composing',
|
||||
use_values=False)
|
||||
|
||||
|
||||
msg['chat_state'].gone()
|
||||
self.checkMessage(msg, xmlstring % 'gone',
|
||||
use_values=False)
|
||||
msg['chat_state'].gone()
|
||||
self.checkMessage(msg, xmlstring % 'gone',
|
||||
use_values=False)
|
||||
|
||||
msg['chat_state'].inactive()
|
||||
self.checkMessage(msg, xmlstring % 'inactive',
|
||||
use_values=False)
|
||||
msg['chat_state'].inactive()
|
||||
self.checkMessage(msg, xmlstring % 'inactive',
|
||||
use_values=False)
|
||||
|
||||
msg['chat_state'].paused()
|
||||
self.checkMessage(msg, xmlstring % 'paused',
|
||||
use_values=False)
|
||||
msg['chat_state'].paused()
|
||||
self.checkMessage(msg, xmlstring % 'paused',
|
||||
use_values=False)
|
||||
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(TestChatStates)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
import sleekxmpp.plugins.xep_0030 as xep_0030
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@ class TestDisco(SleekTest):
|
|||
def setUp(self):
|
||||
registerStanzaPlugin(Iq, xep_0030.DiscoInfo)
|
||||
registerStanzaPlugin(Iq, xep_0030.DiscoItems)
|
||||
|
||||
|
||||
def testCreateInfoQueryNoNode(self):
|
||||
"""Testing disco#info query with no node."""
|
||||
iq = self.Iq()
|
||||
|
@ -61,7 +61,7 @@ class TestDisco(SleekTest):
|
|||
iq = self.Iq()
|
||||
iq['id'] = "0"
|
||||
iq['disco_info']['node'] = 'foo'
|
||||
iq['disco_info'].addIdentity('conference', 'text', 'Chatroom')
|
||||
iq['disco_info'].addIdentity('conference', 'text', 'Chatroom')
|
||||
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
|
@ -76,8 +76,8 @@ class TestDisco(SleekTest):
|
|||
iq = self.Iq()
|
||||
iq['id'] = "0"
|
||||
iq['disco_info']['node'] = 'foo'
|
||||
iq['disco_info'].addFeature('foo')
|
||||
iq['disco_info'].addFeature('bar')
|
||||
iq['disco_info'].addFeature('foo')
|
||||
iq['disco_info'].addFeature('bar')
|
||||
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
|
@ -93,9 +93,9 @@ class TestDisco(SleekTest):
|
|||
iq = self.Iq()
|
||||
iq['id'] = "0"
|
||||
iq['disco_items']['node'] = 'foo'
|
||||
iq['disco_items'].addItem('user@localhost')
|
||||
iq['disco_items'].addItem('user@localhost', 'foo')
|
||||
iq['disco_items'].addItem('user@localhost', 'bar', 'Testing')
|
||||
iq['disco_items'].addItem('user@localhost')
|
||||
iq['disco_items'].addItem('user@localhost', 'foo')
|
||||
iq['disco_items'].addItem('user@localhost', 'bar', 'Testing')
|
||||
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
|
@ -109,68 +109,68 @@ class TestDisco(SleekTest):
|
|||
|
||||
def testAddRemoveIdentities(self):
|
||||
"""Test adding and removing identities to disco#info stanza"""
|
||||
ids = [('automation', 'commands', 'AdHoc'),
|
||||
('conference', 'text', 'ChatRoom')]
|
||||
ids = [('automation', 'commands', 'AdHoc'),
|
||||
('conference', 'text', 'ChatRoom')]
|
||||
|
||||
info = xep_0030.DiscoInfo()
|
||||
info.addIdentity(*ids[0])
|
||||
self.failUnless(info.getIdentities() == [ids[0]])
|
||||
info = xep_0030.DiscoInfo()
|
||||
info.addIdentity(*ids[0])
|
||||
self.failUnless(info.getIdentities() == [ids[0]])
|
||||
|
||||
info.delIdentity('automation', 'commands')
|
||||
self.failUnless(info.getIdentities() == [])
|
||||
info.delIdentity('automation', 'commands')
|
||||
self.failUnless(info.getIdentities() == [])
|
||||
|
||||
info.setIdentities(ids)
|
||||
self.failUnless(info.getIdentities() == ids)
|
||||
info.setIdentities(ids)
|
||||
self.failUnless(info.getIdentities() == ids)
|
||||
|
||||
info.delIdentity('automation', 'commands')
|
||||
self.failUnless(info.getIdentities() == [ids[1]])
|
||||
info.delIdentity('automation', 'commands')
|
||||
self.failUnless(info.getIdentities() == [ids[1]])
|
||||
|
||||
info.delIdentities()
|
||||
self.failUnless(info.getIdentities() == [])
|
||||
info.delIdentities()
|
||||
self.failUnless(info.getIdentities() == [])
|
||||
|
||||
def testAddRemoveFeatures(self):
|
||||
"""Test adding and removing features to disco#info stanza"""
|
||||
features = ['foo', 'bar', 'baz']
|
||||
features = ['foo', 'bar', 'baz']
|
||||
|
||||
info = xep_0030.DiscoInfo()
|
||||
info.addFeature(features[0])
|
||||
self.failUnless(info.getFeatures() == [features[0]])
|
||||
info = xep_0030.DiscoInfo()
|
||||
info.addFeature(features[0])
|
||||
self.failUnless(info.getFeatures() == [features[0]])
|
||||
|
||||
info.delFeature('foo')
|
||||
self.failUnless(info.getFeatures() == [])
|
||||
info.delFeature('foo')
|
||||
self.failUnless(info.getFeatures() == [])
|
||||
|
||||
info.setFeatures(features)
|
||||
self.failUnless(info.getFeatures() == features)
|
||||
info.setFeatures(features)
|
||||
self.failUnless(info.getFeatures() == features)
|
||||
|
||||
info.delFeature('bar')
|
||||
self.failUnless(info.getFeatures() == ['foo', 'baz'])
|
||||
info.delFeature('bar')
|
||||
self.failUnless(info.getFeatures() == ['foo', 'baz'])
|
||||
|
||||
info.delFeatures()
|
||||
self.failUnless(info.getFeatures() == [])
|
||||
info.delFeatures()
|
||||
self.failUnless(info.getFeatures() == [])
|
||||
|
||||
def testAddRemoveItems(self):
|
||||
"""Test adding and removing items to disco#items stanza"""
|
||||
items = [('user@localhost', None, None),
|
||||
('user@localhost', 'foo', None),
|
||||
('user@localhost', 'bar', 'Test')]
|
||||
items = [('user@localhost', None, None),
|
||||
('user@localhost', 'foo', None),
|
||||
('user@localhost', 'bar', 'Test')]
|
||||
|
||||
info = xep_0030.DiscoItems()
|
||||
self.failUnless(True, ""+str(items[0]))
|
||||
info = xep_0030.DiscoItems()
|
||||
self.failUnless(True, ""+str(items[0]))
|
||||
|
||||
info.addItem(*(items[0]))
|
||||
self.failUnless(info.getItems() == [items[0]], info.getItems())
|
||||
info.addItem(*(items[0]))
|
||||
self.failUnless(info.getItems() == [items[0]], info.getItems())
|
||||
|
||||
info.delItem('user@localhost')
|
||||
self.failUnless(info.getItems() == [])
|
||||
info.delItem('user@localhost')
|
||||
self.failUnless(info.getItems() == [])
|
||||
|
||||
info.setItems(items)
|
||||
self.failUnless(info.getItems() == items)
|
||||
info.setItems(items)
|
||||
self.failUnless(info.getItems() == items)
|
||||
|
||||
info.delItem('user@localhost', 'foo')
|
||||
self.failUnless(info.getItems() == [items[0], items[2]])
|
||||
info.delItem('user@localhost', 'foo')
|
||||
self.failUnless(info.getItems() == [items[0], items[2]])
|
||||
|
||||
info.delItems()
|
||||
self.failUnless(info.getItems() == [])
|
||||
|
||||
info.delItems()
|
||||
self.failUnless(info.getItems() == [])
|
||||
|
||||
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(TestDisco)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
|
||||
class TestErrorStanzas(SleekTest):
|
||||
|
||||
|
||||
def testSetup(self):
|
||||
"""Test setting initial values in error stanza."""
|
||||
msg = self.Message()
|
||||
|
@ -16,7 +16,7 @@ class TestErrorStanzas(SleekTest):
|
|||
|
||||
def testCondition(self):
|
||||
"""Test modifying the error condition."""
|
||||
msg = self.Message()
|
||||
msg = self.Message()
|
||||
msg['error']['condition'] = 'item-not-found'
|
||||
|
||||
self.checkMessage(msg, """
|
||||
|
@ -42,7 +42,7 @@ class TestErrorStanzas(SleekTest):
|
|||
msg = self.Message()
|
||||
msg['error']['text'] = 'Error!'
|
||||
msg['error']['condition'] = 'internal-server-error'
|
||||
|
||||
|
||||
del msg['error']['condition']
|
||||
|
||||
self.checkMessage(msg, """
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import sleekxmpp
|
||||
from sleektest import *
|
||||
from . sleektest import *
|
||||
|
||||
|
||||
class TestEvents(SleekTest):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
import sleekxmpp.plugins.xep_0004 as xep_0004
|
||||
|
||||
|
||||
|
@ -28,11 +28,11 @@ class TestDataForms(SleekTest):
|
|||
|
||||
msg = self.Message()
|
||||
form = msg['form']
|
||||
form.addField(var='f1',
|
||||
ftype='text-single',
|
||||
form.addField(var='f1',
|
||||
ftype='text-single',
|
||||
label='Text',
|
||||
desc='A text field',
|
||||
required=True,
|
||||
desc='A text field',
|
||||
required=True,
|
||||
value='Some text!')
|
||||
|
||||
self.checkMessage(msg, """
|
||||
|
@ -47,8 +47,8 @@ class TestDataForms(SleekTest):
|
|||
</message>
|
||||
""")
|
||||
|
||||
form['fields'] = [('f1', {'type': 'text-single',
|
||||
'label': 'Username',
|
||||
form['fields'] = [('f1', {'type': 'text-single',
|
||||
'label': 'Username',
|
||||
'required': True}),
|
||||
('f2', {'type': 'text-private',
|
||||
'label': 'Password',
|
||||
|
@ -58,7 +58,7 @@ class TestDataForms(SleekTest):
|
|||
'value': 'Enter message.\nA long one even.'}),
|
||||
('f4', {'type': 'list-single',
|
||||
'label': 'Message Type',
|
||||
'options': [{'label': 'Cool!',
|
||||
'options': [{'label': 'Cool!',
|
||||
'value': 'cool'},
|
||||
{'label': 'Urgh!',
|
||||
'value': 'urgh'}]})]
|
||||
|
@ -89,13 +89,13 @@ class TestDataForms(SleekTest):
|
|||
|
||||
def testSetValues(self):
|
||||
"""Testing setting form values"""
|
||||
|
||||
|
||||
msg = self.Message()
|
||||
form = msg['form']
|
||||
form.setFields([
|
||||
('foo', {'type': 'text-single'}),
|
||||
('bar', {'type': 'list-multi'})])
|
||||
|
||||
|
||||
form.setValues({'foo': 'Foo!',
|
||||
'bar': ['a', 'b']})
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
import sleekxmpp.plugins.gmail_notify as gmail
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
from sleekxmpp.xmlstream.stanzabase import ET
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ class TestIqStanzas(SleekTest):
|
|||
self.checkIq(iq, """
|
||||
<iq id="0" />
|
||||
""")
|
||||
|
||||
|
||||
def testPayload(self):
|
||||
"""Test setting Iq stanza payload."""
|
||||
iq = self.Iq()
|
||||
|
@ -38,10 +38,10 @@ class TestIqStanzas(SleekTest):
|
|||
</iq>
|
||||
""")
|
||||
|
||||
iq = self.Iq()
|
||||
iq = self.Iq()
|
||||
iq['id'] = 'test'
|
||||
iq['error']['condition'] = 'feature-not-implemented'
|
||||
iq['error']['text'] = 'No handlers registered for this request.'
|
||||
iq['error']['condition'] = 'feature-not-implemented'
|
||||
iq['error']['text'] = 'No handlers registered for this request.'
|
||||
|
||||
self.streamSendIq(iq, """
|
||||
<iq id="test" type="error">
|
||||
|
@ -72,21 +72,21 @@ class TestIqStanzas(SleekTest):
|
|||
</iq>
|
||||
""")
|
||||
|
||||
self.failUnless(iq['query'] == 'query_ns2', "Query namespace doesn't match")
|
||||
self.failUnless(iq['query'] == 'query_ns2', "Query namespace doesn't match")
|
||||
|
||||
del iq['query']
|
||||
self.checkIq(iq, """
|
||||
del iq['query']
|
||||
self.checkIq(iq, """
|
||||
<iq id="0" />
|
||||
""")
|
||||
|
||||
def testReply(self):
|
||||
"""Test setting proper result type in Iq replies."""
|
||||
iq = self.Iq()
|
||||
iq['to'] = 'user@localhost'
|
||||
iq['type'] = 'get'
|
||||
iq['to'] = 'user@localhost'
|
||||
iq['type'] = 'get'
|
||||
iq.reply()
|
||||
|
||||
self.checkIq(iq, """
|
||||
self.checkIq(iq, """
|
||||
<iq id="0" type="result" />
|
||||
""")
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
from sleekxmpp.xmlstream.jid import JID
|
||||
|
||||
class TestJIDClass(SleekTest):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
from sleekxmpp.stanza.message import Message
|
||||
from sleekxmpp.stanza.htmlim import HTMLIM
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import sleekxmpp
|
||||
from sleektest import *
|
||||
from . sleektest import *
|
||||
from sleekxmpp.stanza.presence import Presence
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
import sleekxmpp.plugins.xep_0004 as xep_0004
|
||||
import sleekxmpp.plugins.stanza_pubsub as pubsub
|
||||
|
||||
|
@ -25,7 +25,7 @@ class TestPubsubStanzas(SleekTest):
|
|||
</affiliations>
|
||||
</pubsub>
|
||||
</iq>""")
|
||||
|
||||
|
||||
def testSubscriptions(self):
|
||||
"Testing iq/pubsub/subscriptions/subscription stanzas"
|
||||
iq = self.Iq()
|
||||
|
@ -38,7 +38,7 @@ class TestPubsubStanzas(SleekTest):
|
|||
sub2['subscription'] = 'subscribed'
|
||||
iq['pubsub']['subscriptions'].append(sub1)
|
||||
iq['pubsub']['subscriptions'].append(sub2)
|
||||
self.checkIq(iq, """
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
<pubsub xmlns="http://jabber.org/protocol/pubsub">
|
||||
<subscriptions>
|
||||
|
@ -55,7 +55,7 @@ class TestPubsubStanzas(SleekTest):
|
|||
iq['pubsub']['subscription']['node'] = 'testnode alsdkjfas'
|
||||
iq['pubsub']['subscription']['jid'] = "fritzy@netflint.net/sleekxmpp"
|
||||
iq['pubsub']['subscription']['subscription'] = 'unconfigured'
|
||||
self.checkIq(iq, """
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
<pubsub xmlns="http://jabber.org/protocol/pubsub">
|
||||
<subscription node="testnode alsdkjfas" jid="fritzy@netflint.net/sleekxmpp" subscription="unconfigured">
|
||||
|
@ -88,7 +88,7 @@ class TestPubsubStanzas(SleekTest):
|
|||
item2['payload'] = payload2
|
||||
iq['pubsub']['items'].append(item)
|
||||
iq['pubsub']['items'].append(item2)
|
||||
self.checkIq(iq, """
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
<pubsub xmlns="http://jabber.org/protocol/pubsub">
|
||||
<items>
|
||||
|
@ -112,8 +112,8 @@ class TestPubsubStanzas(SleekTest):
|
|||
"Testing iq/pubsub/create&configure stanzas"
|
||||
iq = self.Iq()
|
||||
iq['pubsub']['create']['node'] = 'mynode'
|
||||
iq['pubsub']['configure']['form'].addField('pubsub#title',
|
||||
ftype='text-single',
|
||||
iq['pubsub']['configure']['form'].addField('pubsub#title',
|
||||
ftype='text-single',
|
||||
value='This thing is awesome')
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
|
@ -131,12 +131,12 @@ class TestPubsubStanzas(SleekTest):
|
|||
|
||||
def testState(self):
|
||||
"Testing iq/psstate stanzas"
|
||||
iq = self.Iq()
|
||||
iq['psstate']['node']= 'mynode'
|
||||
iq = self.Iq()
|
||||
iq['psstate']['node']= 'mynode'
|
||||
iq['psstate']['item']= 'myitem'
|
||||
pl = ET.Element('{http://andyet.net/protocol/pubsubqueue}claimed')
|
||||
iq['psstate']['payload'] = pl
|
||||
self.checkIq(iq, """
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
<state xmlns="http://jabber.org/protocol/psstate" node="mynode" item="myitem">
|
||||
<claimed xmlns="http://andyet.net/protocol/pubsubqueue" />
|
||||
|
@ -144,16 +144,16 @@ class TestPubsubStanzas(SleekTest):
|
|||
</iq>""")
|
||||
|
||||
def testDefault(self):
|
||||
"Testing iq/pubsub_owner/default stanzas"
|
||||
iq = self.Iq()
|
||||
iq['pubsub_owner']['default']
|
||||
iq['pubsub_owner']['default']['node'] = 'mynode'
|
||||
iq['pubsub_owner']['default']['type'] = 'leaf'
|
||||
iq['pubsub_owner']['default']['form'].addField('pubsub#title',
|
||||
ftype='text-single',
|
||||
"Testing iq/pubsub_owner/default stanzas"
|
||||
iq = self.Iq()
|
||||
iq['pubsub_owner']['default']
|
||||
iq['pubsub_owner']['default']['node'] = 'mynode'
|
||||
iq['pubsub_owner']['default']['type'] = 'leaf'
|
||||
iq['pubsub_owner']['default']['form'].addField('pubsub#title',
|
||||
ftype='text-single',
|
||||
value='This thing is awesome')
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
<iq id="0">
|
||||
<pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
|
||||
<default node="mynode" type="leaf">
|
||||
<x xmlns="jabber:x:data" type="form">
|
||||
|
@ -166,54 +166,54 @@ class TestPubsubStanzas(SleekTest):
|
|||
</iq>""", use_values=False)
|
||||
|
||||
def testSubscribe(self):
|
||||
"Testing iq/pubsub/subscribe stanzas"
|
||||
iq = self.Iq()
|
||||
iq['pubsub']['subscribe']['options']
|
||||
iq['pubsub']['subscribe']['node'] = 'cheese'
|
||||
iq['pubsub']['subscribe']['jid'] = 'fritzy@netflint.net/sleekxmpp'
|
||||
iq['pubsub']['subscribe']['options']['node'] = 'cheese'
|
||||
iq['pubsub']['subscribe']['options']['jid'] = 'fritzy@netflint.net/sleekxmpp'
|
||||
form = xep_0004.Form()
|
||||
form.addField('pubsub#title', ftype='text-single', value='This thing is awesome')
|
||||
iq['pubsub']['subscribe']['options']['options'] = form
|
||||
"testing iq/pubsub/subscribe stanzas"
|
||||
iq = self.Iq()
|
||||
iq['pubsub']['subscribe']['options']
|
||||
iq['pubsub']['subscribe']['node'] = 'cheese'
|
||||
iq['pubsub']['subscribe']['jid'] = 'fritzy@netflint.net/sleekxmpp'
|
||||
iq['pubsub']['subscribe']['options']['node'] = 'cheese'
|
||||
iq['pubsub']['subscribe']['options']['jid'] = 'fritzy@netflint.net/sleekxmpp'
|
||||
form = xep_0004.Form()
|
||||
form.addField('pubsub#title', ftype='text-single', value='this thing is awesome')
|
||||
iq['pubsub']['subscribe']['options']['options'] = form
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
<pubsub xmlns="http://jabber.org/protocol/pubsub">
|
||||
<subscribe node="cheese" jid="fritzy@netflint.net/sleekxmpp">
|
||||
<options node="cheese" jid="fritzy@netflint.net/sleekxmpp">
|
||||
<x xmlns="jabber:x:data" type="form">
|
||||
<field var="pubsub#title" type="text-single">
|
||||
<value>This thing is awesome</value>
|
||||
</field>
|
||||
</x>
|
||||
</options>
|
||||
</subscribe>
|
||||
</pubsub>
|
||||
</iq>""", use_values=False)
|
||||
<iq id="0">
|
||||
<pubsub xmlns="http://jabber.org/protocol/pubsub">
|
||||
<subscribe node="cheese" jid="fritzy@netflint.net/sleekxmpp">
|
||||
<options node="cheese" jid="fritzy@netflint.net/sleekxmpp">
|
||||
<x xmlns="jabber:x:data" type="form">
|
||||
<field var="pubsub#title" type="text-single">
|
||||
<value>this thing is awesome</value>
|
||||
</field>
|
||||
</x>
|
||||
</options>
|
||||
</subscribe>
|
||||
</pubsub>
|
||||
</iq>""", use_values=False)
|
||||
|
||||
def testPublish(self):
|
||||
"Testing iq/pubsub/publish stanzas"
|
||||
iq = self.Iq()
|
||||
iq['pubsub']['publish']['node'] = 'thingers'
|
||||
payload = ET.fromstring("""
|
||||
"Testing iq/pubsub/publish stanzas"
|
||||
iq = self.Iq()
|
||||
iq['pubsub']['publish']['node'] = 'thingers'
|
||||
payload = ET.fromstring("""
|
||||
<thinger xmlns="http://andyet.net/protocol/thinger" x="1" y='2'>
|
||||
<child1 />
|
||||
<child2 normandy='cheese' foo='bar' />
|
||||
</thinger>""")
|
||||
payload2 = ET.fromstring("""
|
||||
payload2 = ET.fromstring("""
|
||||
<thinger2 xmlns="http://andyet.net/protocol/thinger2" x="12" y='22'>
|
||||
<child12 />
|
||||
<child22 normandy='cheese2' foo='bar2' />
|
||||
</thinger2>""")
|
||||
item = pubsub.Item()
|
||||
item['id'] = 'asdf'
|
||||
item['payload'] = payload
|
||||
item2 = pubsub.Item()
|
||||
item2['id'] = 'asdf2'
|
||||
item2['payload'] = payload2
|
||||
iq['pubsub']['publish'].append(item)
|
||||
iq['pubsub']['publish'].append(item2)
|
||||
|
||||
item = pubsub.Item()
|
||||
item['id'] = 'asdf'
|
||||
item['payload'] = payload
|
||||
item2 = pubsub.Item()
|
||||
item2['id'] = 'asdf2'
|
||||
item2['payload'] = payload2
|
||||
iq['pubsub']['publish'].append(item)
|
||||
iq['pubsub']['publish'].append(item2)
|
||||
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
<pubsub xmlns="http://jabber.org/protocol/pubsub">
|
||||
|
@ -235,19 +235,19 @@ class TestPubsubStanzas(SleekTest):
|
|||
</iq>""")
|
||||
|
||||
def testDelete(self):
|
||||
"Testing iq/pubsub_owner/delete stanzas"
|
||||
iq = self.Iq()
|
||||
iq['pubsub_owner']['delete']['node'] = 'thingers'
|
||||
"Testing iq/pubsub_owner/delete stanzas"
|
||||
iq = self.Iq()
|
||||
iq['pubsub_owner']['delete']['node'] = 'thingers'
|
||||
self.checkIq(iq, """
|
||||
<iq id="0">
|
||||
<iq id="0">
|
||||
<pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
|
||||
<delete node="thingers" />
|
||||
</pubsub>
|
||||
</iq>""")
|
||||
|
||||
def testCreateConfigGet(self):
|
||||
"""Testing getting config from full create"""
|
||||
iq = self.Iq()
|
||||
"""Testing getting config from full create"""
|
||||
iq = self.Iq()
|
||||
iq['to'] = 'pubsub.asdf'
|
||||
iq['from'] = 'fritzy@asdf/87292ede-524d-4117-9076-d934ed3db8e7'
|
||||
iq['type'] = 'set'
|
||||
|
@ -348,16 +348,16 @@ class TestPubsubStanzas(SleekTest):
|
|||
</iq>""")
|
||||
|
||||
def testItemEvent(self):
|
||||
"""Testing message/pubsub_event/items/item"""
|
||||
msg = self.Message()
|
||||
item = pubsub.EventItem()
|
||||
pl = ET.Element('{http://netflint.net/protocol/test}test', {'failed':'3', 'passed':'24'})
|
||||
item['payload'] = pl
|
||||
item['id'] = 'abc123'
|
||||
msg['pubsub_event']['items'].append(item)
|
||||
msg['pubsub_event']['items']['node'] = 'cheese'
|
||||
msg['type'] = 'normal'
|
||||
self.checkMessage(msg, """
|
||||
"""Testing message/pubsub_event/items/item"""
|
||||
msg = self.Message()
|
||||
item = pubsub.EventItem()
|
||||
pl = ET.Element('{http://netflint.net/protocol/test}test', {'failed':'3', 'passed':'24'})
|
||||
item['payload'] = pl
|
||||
item['id'] = 'abc123'
|
||||
msg['pubsub_event']['items'].append(item)
|
||||
msg['pubsub_event']['items']['node'] = 'cheese'
|
||||
msg['type'] = 'normal'
|
||||
self.checkMessage(msg, """
|
||||
<message type="normal">
|
||||
<event xmlns="http://jabber.org/protocol/pubsub#event">
|
||||
<items node="cheese">
|
||||
|
@ -369,21 +369,21 @@ class TestPubsubStanzas(SleekTest):
|
|||
</message>""")
|
||||
|
||||
def testItemsEvent(self):
|
||||
"""Testing multiple message/pubsub_event/items/item"""
|
||||
msg = self.Message()
|
||||
item = pubsub.EventItem()
|
||||
item2 = pubsub.EventItem()
|
||||
pl = ET.Element('{http://netflint.net/protocol/test}test', {'failed':'3', 'passed':'24'})
|
||||
pl2 = ET.Element('{http://netflint.net/protocol/test-other}test', {'total':'27', 'failed':'3'})
|
||||
item2['payload'] = pl2
|
||||
item['payload'] = pl
|
||||
item['id'] = 'abc123'
|
||||
item2['id'] = '123abc'
|
||||
msg['pubsub_event']['items'].append(item)
|
||||
msg['pubsub_event']['items'].append(item2)
|
||||
msg['pubsub_event']['items']['node'] = 'cheese'
|
||||
msg['type'] = 'normal'
|
||||
self.checkMessage(msg, """
|
||||
"""Testing multiple message/pubsub_event/items/item"""
|
||||
msg = self.Message()
|
||||
item = pubsub.EventItem()
|
||||
item2 = pubsub.EventItem()
|
||||
pl = ET.Element('{http://netflint.net/protocol/test}test', {'failed':'3', 'passed':'24'})
|
||||
pl2 = ET.Element('{http://netflint.net/protocol/test-other}test', {'total':'27', 'failed':'3'})
|
||||
item2['payload'] = pl2
|
||||
item['payload'] = pl
|
||||
item['id'] = 'abc123'
|
||||
item2['id'] = '123abc'
|
||||
msg['pubsub_event']['items'].append(item)
|
||||
msg['pubsub_event']['items'].append(item2)
|
||||
msg['pubsub_event']['items']['node'] = 'cheese'
|
||||
msg['type'] = 'normal'
|
||||
self.checkMessage(msg, """
|
||||
<message type="normal">
|
||||
<event xmlns="http://jabber.org/protocol/pubsub#event">
|
||||
<items node="cheese">
|
||||
|
@ -398,24 +398,24 @@ class TestPubsubStanzas(SleekTest):
|
|||
</message>""")
|
||||
|
||||
def testItemsEvent(self):
|
||||
"""Testing message/pubsub_event/items/item & retract mix"""
|
||||
msg = self.Message()
|
||||
item = pubsub.EventItem()
|
||||
item2 = pubsub.EventItem()
|
||||
pl = ET.Element('{http://netflint.net/protocol/test}test', {'failed':'3', 'passed':'24'})
|
||||
pl2 = ET.Element('{http://netflint.net/protocol/test-other}test', {'total':'27', 'failed':'3'})
|
||||
item2['payload'] = pl2
|
||||
retract = pubsub.EventRetract()
|
||||
retract['id'] = 'aabbcc'
|
||||
item['payload'] = pl
|
||||
item['id'] = 'abc123'
|
||||
item2['id'] = '123abc'
|
||||
msg['pubsub_event']['items'].append(item)
|
||||
msg['pubsub_event']['items'].append(retract)
|
||||
msg['pubsub_event']['items'].append(item2)
|
||||
msg['pubsub_event']['items']['node'] = 'cheese'
|
||||
msg['type'] = 'normal'
|
||||
self.checkMessage(msg, """
|
||||
"""Testing message/pubsub_event/items/item & retract mix"""
|
||||
msg = self.Message()
|
||||
item = pubsub.EventItem()
|
||||
item2 = pubsub.EventItem()
|
||||
pl = ET.Element('{http://netflint.net/protocol/test}test', {'failed':'3', 'passed':'24'})
|
||||
pl2 = ET.Element('{http://netflint.net/protocol/test-other}test', {'total':'27', 'failed':'3'})
|
||||
item2['payload'] = pl2
|
||||
retract = pubsub.EventRetract()
|
||||
retract['id'] = 'aabbcc'
|
||||
item['payload'] = pl
|
||||
item['id'] = 'abc123'
|
||||
item2['id'] = '123abc'
|
||||
msg['pubsub_event']['items'].append(item)
|
||||
msg['pubsub_event']['items'].append(retract)
|
||||
msg['pubsub_event']['items'].append(item2)
|
||||
msg['pubsub_event']['items']['node'] = 'cheese'
|
||||
msg['type'] = 'normal'
|
||||
self.checkMessage(msg, """
|
||||
<message type="normal">
|
||||
<event xmlns="http://jabber.org/protocol/pubsub#event">
|
||||
<items node="cheese">
|
||||
|
@ -430,12 +430,12 @@ class TestPubsubStanzas(SleekTest):
|
|||
</message>""")
|
||||
|
||||
def testCollectionAssociate(self):
|
||||
"""Testing message/pubsub_event/collection/associate"""
|
||||
msg = self.Message()
|
||||
msg['pubsub_event']['collection']['associate']['node'] = 'cheese'
|
||||
msg['pubsub_event']['collection']['node'] = 'cheeseburger'
|
||||
msg['type'] = 'headline'
|
||||
self.checkMessage(msg, """
|
||||
"""Testing message/pubsub_event/collection/associate"""
|
||||
msg = self.Message()
|
||||
msg['pubsub_event']['collection']['associate']['node'] = 'cheese'
|
||||
msg['pubsub_event']['collection']['node'] = 'cheeseburger'
|
||||
msg['type'] = 'headline'
|
||||
self.checkMessage(msg, """
|
||||
<message type="headline">
|
||||
<event xmlns="http://jabber.org/protocol/pubsub#event">
|
||||
<collection node="cheeseburger">
|
||||
|
@ -445,12 +445,12 @@ class TestPubsubStanzas(SleekTest):
|
|||
</message>""")
|
||||
|
||||
def testCollectionDisassociate(self):
|
||||
"""Testing message/pubsub_event/collection/disassociate"""
|
||||
msg = self.Message()
|
||||
msg['pubsub_event']['collection']['disassociate']['node'] = 'cheese'
|
||||
msg['pubsub_event']['collection']['node'] = 'cheeseburger'
|
||||
msg['type'] = 'headline'
|
||||
self.checkMessage(msg, """
|
||||
"""Testing message/pubsub_event/collection/disassociate"""
|
||||
msg = self.Message()
|
||||
msg['pubsub_event']['collection']['disassociate']['node'] = 'cheese'
|
||||
msg['pubsub_event']['collection']['node'] = 'cheeseburger'
|
||||
msg['type'] = 'headline'
|
||||
self.checkMessage(msg, """
|
||||
<message type="headline">
|
||||
<event xmlns="http://jabber.org/protocol/pubsub#event">
|
||||
<collection node="cheeseburger">
|
||||
|
@ -460,15 +460,15 @@ class TestPubsubStanzas(SleekTest):
|
|||
</message>""")
|
||||
|
||||
def testEventConfiguration(self):
|
||||
"""Testing message/pubsub_event/configuration/config"""
|
||||
msg = self.Message()
|
||||
msg['pubsub_event']['configuration']['node'] = 'cheese'
|
||||
msg['pubsub_event']['configuration']['form'].addField('pubsub#title',
|
||||
ftype='text-single',
|
||||
"""Testing message/pubsub_event/configuration/config"""
|
||||
msg = self.Message()
|
||||
msg['pubsub_event']['configuration']['node'] = 'cheese'
|
||||
msg['pubsub_event']['configuration']['form'].addField('pubsub#title',
|
||||
ftype='text-single',
|
||||
value='This thing is awesome')
|
||||
msg['type'] = 'headline'
|
||||
msg['type'] = 'headline'
|
||||
self.checkMessage(msg, """
|
||||
<message type="headline">
|
||||
<message type="headline">
|
||||
<event xmlns="http://jabber.org/protocol/pubsub#event">
|
||||
<configuration node="cheese">
|
||||
<x xmlns="jabber:x:data" type="form">
|
||||
|
@ -481,11 +481,11 @@ class TestPubsubStanzas(SleekTest):
|
|||
</message>""")
|
||||
|
||||
def testEventPurge(self):
|
||||
"""Testing message/pubsub_event/purge"""
|
||||
msg = self.Message()
|
||||
msg['pubsub_event']['purge']['node'] = 'pickles'
|
||||
msg['type'] = 'headline'
|
||||
self.checkMessage(msg, """
|
||||
"""Testing message/pubsub_event/purge"""
|
||||
msg = self.Message()
|
||||
msg['pubsub_event']['purge']['node'] = 'pickles'
|
||||
msg['type'] = 'headline'
|
||||
self.checkMessage(msg, """
|
||||
<message type="headline">
|
||||
<event xmlns="http://jabber.org/protocol/pubsub#event">
|
||||
<purge node="pickles" />
|
||||
|
@ -493,15 +493,15 @@ class TestPubsubStanzas(SleekTest):
|
|||
</message>""")
|
||||
|
||||
def testEventSubscription(self):
|
||||
"""Testing message/pubsub_event/subscription"""
|
||||
msg = self.Message()
|
||||
msg['pubsub_event']['subscription']['node'] = 'pickles'
|
||||
msg['pubsub_event']['subscription']['jid'] = 'fritzy@netflint.net/test'
|
||||
msg['pubsub_event']['subscription']['subid'] = 'aabb1122'
|
||||
msg['pubsub_event']['subscription']['subscription'] = 'subscribed'
|
||||
msg['pubsub_event']['subscription']['expiry'] = 'presence'
|
||||
msg['type'] = 'headline'
|
||||
self.checkMessage(msg, """
|
||||
"""Testing message/pubsub_event/subscription"""
|
||||
msg = self.Message()
|
||||
msg['pubsub_event']['subscription']['node'] = 'pickles'
|
||||
msg['pubsub_event']['subscription']['jid'] = 'fritzy@netflint.net/test'
|
||||
msg['pubsub_event']['subscription']['subid'] = 'aabb1122'
|
||||
msg['pubsub_event']['subscription']['subscription'] = 'subscribed'
|
||||
msg['pubsub_event']['subscription']['expiry'] = 'presence'
|
||||
msg['type'] = 'headline'
|
||||
self.checkMessage(msg, """
|
||||
<message type="headline">
|
||||
<event xmlns="http://jabber.org/protocol/pubsub#event">
|
||||
<subscription node="pickles" subid="aabb1122" jid="fritzy@netflint.net/test" subscription="subscribed" expiry="presence" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from sleektest import *
|
||||
from . sleektest import *
|
||||
import sleekxmpp.plugins.xep_0033 as xep_0033
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue