summaryrefslogtreecommitdiff
path: root/tests/test_stanza_element.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-11-05 14:45:58 -0400
committerLance Stout <lancestout@gmail.com>2010-11-05 21:18:48 -0400
commitd0c506f93010f62cd447ce29f98ab991f521ec99 (patch)
tree80c994852cc04d4680c5db9c7e3abca77810e44e /tests/test_stanza_element.py
parent7351fe1a0226298419e3d174d7b156daad91c131 (diff)
downloadslixmpp-d0c506f93010f62cd447ce29f98ab991f521ec99.tar.gz
slixmpp-d0c506f93010f62cd447ce29f98ab991f521ec99.tar.bz2
slixmpp-d0c506f93010f62cd447ce29f98ab991f521ec99.tar.xz
slixmpp-d0c506f93010f62cd447ce29f98ab991f521ec99.zip
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.
Diffstat (limited to 'tests/test_stanza_element.py')
-rw-r--r--tests/test_stanza_element.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/test_stanza_element.py b/tests/test_stanza_element.py
index d361d6ff..f7387d36 100644
--- a/tests/test_stanza_element.py
+++ b/tests/test_stanza_element.py
@@ -27,7 +27,7 @@ class TestElementBase(SleekTest):
namespace = "test"
stanza = TestStanza()
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="test">
<bar>
<baz />
@@ -117,7 +117,7 @@ class TestElementBase(SleekTest):
'baz': ''}]}
stanza.setStanzaValues(values)
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo" bar="a">
<pluginfoo baz="b" />
<pluginfoo2 bar="d" baz="e" />
@@ -198,7 +198,7 @@ class TestElementBase(SleekTest):
stanza['qux'] = 'overridden'
stanza['foobar'] = 'plugin'
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo" bar="attribute!">
<baz>element!</baz>
<foobar foobar="plugin" />
@@ -231,7 +231,7 @@ class TestElementBase(SleekTest):
stanza['qux'] = 'c'
stanza['foobar']['foobar'] = 'd'
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo" baz="b" qux="c">
<bar>a</bar>
<foobar foobar="d" />
@@ -243,7 +243,7 @@ class TestElementBase(SleekTest):
del stanza['qux']
del stanza['foobar']
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo" qux="c" />
""")
@@ -257,7 +257,7 @@ class TestElementBase(SleekTest):
stanza = TestStanza()
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo" />
""")
@@ -267,7 +267,7 @@ class TestElementBase(SleekTest):
stanza._set_attr('bar', 'a')
stanza._set_attr('baz', 'b')
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo" bar="a" baz="b" />
""")
@@ -277,7 +277,7 @@ class TestElementBase(SleekTest):
stanza._set_attr('bar', None)
stanza._del_attr('baz')
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo" />
""")
@@ -307,7 +307,7 @@ class TestElementBase(SleekTest):
"Default _get_sub_text value incorrect.")
stanza['bar'] = 'found'
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo">
<wrapper>
<bar>found</bar>
@@ -340,7 +340,7 @@ class TestElementBase(SleekTest):
stanza = TestStanza()
stanza['bar'] = 'a'
stanza['baz'] = 'b'
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo">
<wrapper>
<bar>a</bar>
@@ -349,7 +349,7 @@ class TestElementBase(SleekTest):
</foo>
""")
stanza._set_sub_text('wrapper/bar', text='', keep=True)
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo">
<wrapper>
<bar />
@@ -360,7 +360,7 @@ class TestElementBase(SleekTest):
stanza['bar'] = 'a'
stanza._set_sub_text('wrapper/bar', text='')
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo">
<wrapper>
<baz>b</baz>
@@ -398,7 +398,7 @@ class TestElementBase(SleekTest):
stanza['bar'] = 'a'
stanza['baz'] = 'b'
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo">
<path>
<to>
@@ -416,7 +416,7 @@ class TestElementBase(SleekTest):
del stanza['bar']
del stanza['baz']
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo">
<path>
<to>
@@ -432,7 +432,7 @@ class TestElementBase(SleekTest):
stanza._del_sub('path/to/only/bar', all=True)
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo">
<path>
<to>
@@ -603,7 +603,7 @@ class TestElementBase(SleekTest):
"Incorrect empty stanza size.")
stanza.append(substanza1)
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo">
<foobar qux="a" />
</foo>
@@ -612,7 +612,7 @@ class TestElementBase(SleekTest):
"Incorrect stanza size with 1 substanza.")
stanza.append(substanza2)
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo">
<foobar qux="a" />
<foobar qux="b" />
@@ -623,7 +623,7 @@ class TestElementBase(SleekTest):
# Test popping substanzas
stanza.pop(0)
- self.check_stanza(TestStanza, stanza, """
+ self.check(stanza, """
<foo xmlns="foo">
<foobar qux="b" />
</foo>