Skip to content

Commit

Permalink
fix ProtocolTest for Protocol.app_authorize
Browse files Browse the repository at this point in the history
  • Loading branch information
knipknap committed Mar 22, 2017
1 parent 3fd3a98 commit 89ac7b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/Exscript/protocols/DummyTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
9 changes: 5 additions & 4 deletions tests/Exscript/protocols/ProtocolTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 89ac7b6

Please sign in to comment.