Standalone Authenticator: no fail when port taken (fixes #381)

This commit is contained in:
Jakub Warmuz 2015-06-02 18:30:48 +00:00
parent 34ed54079d
commit 4646d8d6bf
No known key found for this signature in database
GPG key ID: 2A7BAD3A489B52EA
2 changed files with 2 additions and 1 deletions

View file

@ -152,7 +152,6 @@ class StandaloneAuthenticator(common.Plugin):
:rtype: bool
"""
display = zope.component.getUtility(interfaces.IDisplay)
start_time = time.time()

View file

@ -317,6 +317,7 @@ class PerformTest(unittest.TestCase):
"""What happens if start_listener() returns True."""
self.authenticator.start_listener = mock.Mock()
self.authenticator.start_listener.return_value = True
self.authenticator.already_listening = mock.Mock(return_value=False)
result = self.authenticator.perform(self.achalls)
self.assertEqual(len(self.authenticator.tasks), 2)
self.assertTrue(
@ -335,6 +336,7 @@ class PerformTest(unittest.TestCase):
"""What happens if start_listener() returns False."""
self.authenticator.start_listener = mock.Mock()
self.authenticator.start_listener.return_value = False
self.authenticator.already_listening = mock.Mock(return_value=False)
result = self.authenticator.perform(self.achalls)
self.assertEqual(len(self.authenticator.tasks), 2)
self.assertTrue(