-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix registering a user #15
Conversation
… loopbackAsync using its own transports
# Copyright 2013 Twisted Matrix Laboratories. See LICENSE file for details | ||
|
||
""" | ||
Tests for the AddUser (AMP Command) responder and client parts of vertex. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This describes the current content of this file, but the current test coverage is poor, so more is going to be added. I think the docstring should describe what should go in this file, rather than what is currently in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that it is tests for the user-registration.
'username': username, | ||
'password': password}) | ||
|
||
store = stub(addUser=addUser) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not used pretend
before, but this looks like pretend.call_recorder
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, you are right. addUser
can just be call_recorder
from vertex.q2q import Q2QAddress | ||
from vertex.q2qadmin import AddUser | ||
from vertex.q2qstandalone import IdentityAdmin | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well follow the Twisted coding standard here, 3-2-1
Thanks for improving the test coverage. My comments notwithstanding I think we should just merge this now. |
An attempt to address #14.
Fixes old AMP usage and adds a sorta test to make sure that
q2qclient.UserAdder
can successfullycallRemote
toq2qstandalone.IdentityAdmin
.Tried to use
loopbackAsync
, butIdentityAdmin
depends on having a transport that has a methodgetQ2QHost
, andloopbackAsync
uses its own transport, which does not have such a method, and the transport doesn't get exposed for me to patch it. So usingtwisted.test.iosim
instead.Also included a dependency on https://github.com/alex/pretend for testing.
Edit: any fixes to q2q client are superceded by #16, so remove all fixes in this PR.