diff options
author | Lance Stout <lancestout@gmail.com> | 2011-01-26 11:27:41 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-01-26 11:27:41 -0500 |
commit | 0c8a8314b2e70d4a82b1c199b7e5bc16b494e275 (patch) | |
tree | 2f8b2c35afe1882a8f0b5011d76980c6099b2fed /sleekxmpp/test | |
parent | 4e757c2b56e7c4ded0a3de9e49c550db36da72d2 (diff) | |
download | slixmpp-0c8a8314b2e70d4a82b1c199b7e5bc16b494e275.tar.gz slixmpp-0c8a8314b2e70d4a82b1c199b7e5bc16b494e275.tar.bz2 slixmpp-0c8a8314b2e70d4a82b1c199b7e5bc16b494e275.tar.xz slixmpp-0c8a8314b2e70d4a82b1c199b7e5bc16b494e275.zip |
Cleanup for stanzabase.
Use stanza.values instead of _get/set_stanza_values where used.
ElementBase stanzas can now use .tag
May use class method tag_name() for stanza classes.
ElementBase now has .clear() method.
Diffstat (limited to 'sleekxmpp/test')
-rw-r--r-- | sleekxmpp/test/sleektest.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py index aa411cd7..b5c28fde 100644 --- a/sleekxmpp/test/sleektest.py +++ b/sleekxmpp/test/sleektest.py @@ -157,8 +157,7 @@ class SleekTest(unittest.TestCase): """ Create and compare several stanza objects to a correct XML string. - If use_values is False, test using getStanzaValues() and - setStanzaValues() will not be used. + If use_values is False, tests using stanza.values will not be used. Some stanzas provide default values for some interfaces, but these defaults can be problematic for testing since they can easily @@ -181,9 +180,8 @@ class SleekTest(unittest.TestCase): values. These interfaces will be set to their defaults for the given and generated stanzas to prevent unexpected test failures. - use_values -- Indicates if testing using getStanzaValues() and - setStanzaValues() should be used. Defaults to - True. + use_values -- Indicates if testing using stanza.values should + be used. Defaults to True. """ if method is None and hasattr(self, 'match_method'): method = getattr(self, 'match_method') @@ -216,10 +214,10 @@ class SleekTest(unittest.TestCase): stanza2 = stanza_class(xml=xml) if use_values: - # Using getStanzaValues() and setStanzaValues() will add - # XML for any interface that has a default value. We need - # to set those defaults on the existing stanzas and XML - # so that they will compare correctly. + # Using stanza.values will add XML for any interface that + # has a default value. We need to set those defaults on + # the existing stanzas and XML so that they will compare + # correctly. default_stanza = stanza_class() if defaults is None: known_defaults = { @@ -238,9 +236,9 @@ class SleekTest(unittest.TestCase): value = default_stanza.xml.attrib[interface] xml.attrib[interface] = value - values = stanza2.getStanzaValues() + values = stanza2.values stanza3 = stanza_class() - stanza3.setStanzaValues(values) + stanza3.values = values debug = "Three methods for creating stanzas do not match.\n" debug += "Given XML:\n%s\n" % tostring(xml) @@ -390,8 +388,7 @@ class SleekTest(unittest.TestCase): 'id', 'stanzapath', 'xpath', and 'mask'. Defaults to the value of self.match_method. use_values -- Indicates if stanza comparisons should test using - getStanzaValues() and setStanzaValues(). - Defaults to True. + stanza.values. Defaults to True. timeout -- Time to wait in seconds for data to be received by a live connection. """ |