Fix test_client test

This commit is contained in:
Calum Lind 2013-05-16 12:54:33 +01:00
parent cf669f3cfa
commit 235b7348ae
1 changed files with 5 additions and 7 deletions

View File

@ -71,16 +71,14 @@ class ClientTestCase(unittest.TestCase):
def test_connect_no_credentials(self):
d = client.connect("localhost", 58846)
d = client.connect()
def on_failure(failure):
self.assertEqual(
failure.trap(error.AuthenticationRequired),
error.AuthenticationRequired
)
def on_connect(result):
self.assertEqual(client.get_auth_level(), AUTH_LEVEL_ADMIN)
self.addCleanup(client.disconnect)
return result
d.addErrback(on_failure)
d.addCallback(on_connect)
return d
def test_connect_localclient(self):