def test_authenticate_success(self):
    self.mocked_auth_user.return_value = 1, 'abc', 'paris', 'admin'

def _doTest(auth_result):
    attempted_auth_result = {'secret': 'abc', 'role': 'admin', 'authid':
        '1', 'salt': 'paris', 'iterations': 1000, 'keylen': 32}
self.assertEqual(auth_result, attempted_auth_result)
self.mocked_auth_user.assert_called_with(self.api.database, 'raito')
return self.api.authenticate('test', 'raito', {}).addCallback(_doTest)
How to do unit test on Autobahn applications using Twisted Trial?