Fix test_client test
This commit is contained in:
parent
cf669f3cfa
commit
235b7348ae
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue