From 7a5ef2849218e122b04e244aeedd67844a0690b2 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 11 Aug 2010 18:41:57 -0400 Subject: Updated SleekTest.streamClose to check that the stream was actually started before closing it. Updated tests for Iq stanzas to not start a stream for every test; tests now run a lot faster. The call to streamClose must still be in the tearDown method to ensure it is called in the case of an error. --- tests/sleektest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/sleektest.py') diff --git a/tests/sleektest.py b/tests/sleektest.py index a7116544..0adab2b2 100644 --- a/tests/sleektest.py +++ b/tests/sleektest.py @@ -258,7 +258,7 @@ class SleekTest(unittest.TestCase): self.checkPresence(data, sent, use_values) def streamClose(self): - if self.xmpp is not None: + if hasattr(self, 'xmpp') and self.xmpp is not None: self.xmpp.disconnect() self.xmpp.socket.recvData(self.xmpp.stream_footer) -- cgit v1.2.3