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): def test_connect_no_credentials(self):
d = client.connect("localhost", 58846) d = client.connect()
def on_failure(failure): def on_connect(result):
self.assertEqual( self.assertEqual(client.get_auth_level(), AUTH_LEVEL_ADMIN)
failure.trap(error.AuthenticationRequired),
error.AuthenticationRequired
)
self.addCleanup(client.disconnect) self.addCleanup(client.disconnect)
return result
d.addErrback(on_failure) d.addCallback(on_connect)
return d return d
def test_connect_localclient(self): def test_connect_localclient(self):