diff options
author | Florian Klien <flowolf@klienux.org> | 2018-10-08 23:25:23 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-10-15 14:59:23 +0200 |
commit | d33366badde6a2d51be8d731834540c03b9a6c49 (patch) | |
tree | 8ecbb3de477371a29e95f1aa4d93b619bfa5f5e4 /tests/test_stanza_base.py | |
parent | 809c50000204f8724bac80cb3359a690fdbc839e (diff) | |
download | slixmpp-d33366badde6a2d51be8d731834540c03b9a6c49.tar.gz slixmpp-d33366badde6a2d51be8d731834540c03b9a6c49.tar.bz2 slixmpp-d33366badde6a2d51be8d731834540c03b9a6c49.tar.xz slixmpp-d33366badde6a2d51be8d731834540c03b9a6c49.zip |
fixing deprecation warnings for pytest
Diffstat (limited to 'tests/test_stanza_base.py')
-rw-r--r-- | tests/test_stanza_base.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/test_stanza_base.py b/tests/test_stanza_base.py index dac3f046..35fa5e99 100644 --- a/tests/test_stanza_base.py +++ b/tests/test_stanza_base.py @@ -9,37 +9,37 @@ class TestStanzaBase(SlixTest): """Test the 'to' interface of StanzaBase.""" stanza = StanzaBase() stanza['to'] = 'user@example.com' - self.failUnless(str(stanza['to']) == 'user@example.com', + self.assertTrue(str(stanza['to']) == 'user@example.com', "Setting and retrieving stanza 'to' attribute did not work.") def testFrom(self): """Test the 'from' interface of StanzaBase.""" stanza = StanzaBase() stanza['from'] = 'user@example.com' - self.failUnless(str(stanza['from']) == 'user@example.com', + self.assertTrue(str(stanza['from']) == 'user@example.com', "Setting and retrieving stanza 'from' attribute did not work.") def testPayload(self): """Test the 'payload' interface of StanzaBase.""" stanza = StanzaBase() - self.failUnless(stanza['payload'] == [], + self.assertTrue(stanza['payload'] == [], "Empty stanza does not have an empty payload.") stanza['payload'] = ET.Element("{foo}foo") - self.failUnless(len(stanza['payload']) == 1, + self.assertTrue(len(stanza['payload']) == 1, "Stanza contents and payload do not match.") stanza['payload'] = ET.Element('{bar}bar') - self.failUnless(len(stanza['payload']) == 2, + self.assertTrue(len(stanza['payload']) == 2, "Stanza payload was not appended.") del stanza['payload'] - self.failUnless(stanza['payload'] == [], + self.assertTrue(stanza['payload'] == [], "Stanza payload not cleared after deletion.") stanza['payload'] = [ET.Element('{foo}foo'), ET.Element('{bar}bar')] - self.failUnless(len(stanza['payload']) == 2, + self.assertTrue(len(stanza['payload']) == 2, "Adding multiple elements to stanza's payload did not work.") def testClear(self): @@ -49,9 +49,9 @@ class TestStanzaBase(SlixTest): stanza['payload'] = ET.Element("{foo}foo") stanza.clear() - self.failUnless(stanza['payload'] == [], + self.assertTrue(stanza['payload'] == [], "Stanza payload was not cleared after calling .clear()") - self.failUnless(str(stanza['to']) == "user@example.com", + self.assertTrue(str(stanza['to']) == "user@example.com", "Stanza attributes were not preserved after calling .clear()") def testReply(self): @@ -63,9 +63,9 @@ class TestStanzaBase(SlixTest): stanza = stanza.reply() - self.failUnless(str(stanza['to'] == "sender@example.com"), + self.assertTrue(str(stanza['to'] == "sender@example.com"), "Stanza reply did not change 'to' attribute.") - self.failUnless(stanza['payload'] == [], + self.assertTrue(stanza['payload'] == [], "Stanza reply did not empty stanza payload.") def testError(self): @@ -73,7 +73,7 @@ class TestStanzaBase(SlixTest): stanza = StanzaBase() stanza['type'] = 'get' stanza.error() - self.failUnless(stanza['type'] == 'error', + self.assertTrue(stanza['type'] == 'error', "Stanza type is not 'error' after calling error()") |