Updated ElementBase.setup, and added unit tests.

This commit is contained in:
Lance Stout
2010-08-13 12:24:47 -04:00
parent c721fb4126
commit c20fab0f6c
2 changed files with 55 additions and 16 deletions

23
tests/test_elementbase.py Normal file
View File

@@ -0,0 +1,23 @@
from . sleektest import *
from sleekxmpp.xmlstream.stanzabase import ElementBase
class TestElementBase(SleekTest):
def testExtendedName(self):
"""Test element names of the form tag1/tag2/tag3."""
class TestStanza(ElementBase):
name = "foo/bar/baz"
namespace = "test"
stanza = TestStanza()
self.checkStanza(TestStanza, stanza, """
<foo xmlns="test">
<bar>
<baz />
</bar>
</foo>
""")
suite = unittest.TestLoader().loadTestsFromTestCase(TestElementBase)