diff --git a/tests/Exscript/protocols/DummyTest.py b/tests/Exscript/protocols/DummyTest.py index 05b3dbcb..01a7ea44 100644 --- a/tests/Exscript/protocols/DummyTest.py +++ b/tests/Exscript/protocols/DummyTest.py @@ -10,7 +10,7 @@ class DummyTest(ProtocolTest): CORRELATE = Dummy def createProtocol(self): - self.protocol = Dummy(device = self.device) + self.protocol = Dummy(device=self.device) def testConstructor(self): self.assert_(isinstance(self.protocol, Dummy)) diff --git a/tests/Exscript/protocols/ProtocolTest.py b/tests/Exscript/protocols/ProtocolTest.py index c95f123b..57e66d93 100644 --- a/tests/Exscript/protocols/ProtocolTest.py +++ b/tests/Exscript/protocols/ProtocolTest.py @@ -363,12 +363,13 @@ def testAppAuthorize2(self): self.doAppAuthenticate(flush=True) response = self.protocol.response - # Authorize should see that a prompt is still in the buffer, - # and do nothing. - self.doAppAuthorize(flush=True) + # At this point app_authorize should fail because the buffer is + # empty due to flush=True above. In other words, app_authorize + # will wait for a prompt until a timeout happens. + self.assertRaises(TimeoutException, self.doAppAuthorize) self.assert_(self.protocol.is_protocol_authenticated()) self.assert_(self.protocol.is_app_authenticated()) - self.assert_(self.protocol.is_app_authorized()) + self.failIf(self.protocol.is_app_authorized()) def testAutoAppAuthorize(self): # Test can not work on the abstract base.