From 0fffbb82000a1a6c3c23d62fedcbd8e8141f8994 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 7 Oct 2010 10:58:13 -0400 Subject: Unit test reorganization. Moved SleekTest to sleekxmpp.test. Organized test suites by their focus. - Suites focused on testing stanza objects are named test_stanza_X.py - Suites focused on testing stream behavior are name test_stream_X.py --- tests/test_iqstanzas.py | 90 ------------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 tests/test_iqstanzas.py (limited to 'tests/test_iqstanzas.py') diff --git a/tests/test_iqstanzas.py b/tests/test_iqstanzas.py deleted file mode 100644 index 197bc001..00000000 --- a/tests/test_iqstanzas.py +++ /dev/null @@ -1,90 +0,0 @@ -from . sleektest import * -from sleekxmpp.xmlstream.stanzabase import ET - - -class TestIqStanzas(SleekTest): - - def tearDown(self): - """Shutdown the XML stream after testing.""" - self.stream_close() - - def testSetup(self): - """Test initializing default Iq values.""" - iq = self.Iq() - self.check_iq(iq, """ - - """) - - def testPayload(self): - """Test setting Iq stanza payload.""" - iq = self.Iq() - iq.setPayload(ET.Element('{test}tester')) - self.check_iq(iq, """ - - - - """, use_values=False) - - - def testUnhandled(self): - """Test behavior for Iq.unhandled.""" - self.stream_start() - self.stream_recv(""" - - - - """) - - iq = self.Iq() - iq['id'] = 'test' - iq['error']['condition'] = 'feature-not-implemented' - iq['error']['text'] = 'No handlers registered for this request.' - - self.stream_send_iq(iq, """ - - - - - No handlers registered for this request. - - - - """) - - def testQuery(self): - """Test modifying query element of Iq stanzas.""" - iq = self.Iq() - - iq['query'] = 'query_ns' - self.check_iq(iq, """ - - - - """) - - iq['query'] = 'query_ns2' - self.check_iq(iq, """ - - - - """) - - self.failUnless(iq['query'] == 'query_ns2', "Query namespace doesn't match") - - del iq['query'] - self.check_iq(iq, """ - - """) - - def testReply(self): - """Test setting proper result type in Iq replies.""" - iq = self.Iq() - iq['to'] = 'user@localhost' - iq['type'] = 'get' - iq.reply() - - self.check_iq(iq, """ - - """) - -suite = unittest.TestLoader().loadTestsFromTestCase(TestIqStanzas) -- cgit v1.2.3