diff options
author | Philip Paquette <pcpaquette@gmail.com> | 2019-09-11 17:34:18 -0400 |
---|---|---|
committer | Philip Paquette <pcpaquette@gmail.com> | 2019-09-14 18:18:53 -0400 |
commit | 96c5441ac652bb2e7e396381d3fb2e0964ad68da (patch) | |
tree | 29a582fd80553b47ea25d25908f2b624ae5c54c8 /diplomacy/daide | |
parent | 57c9c33ae756cc17af223f6bc671191684ee9c9b (diff) |
channel.authenticate() - Deprecated argument 'create_user'
- User is now created by default if it doesn't exist on the server
- Unless the server prevents new registrations
Diffstat (limited to 'diplomacy/daide')
-rw-r--r-- | diplomacy/daide/request_managers.py | 12 | ||||
-rw-r--r-- | diplomacy/daide/tests/test_daide_game.py | 6 |
2 files changed, 4 insertions, 14 deletions
diff --git a/diplomacy/daide/request_managers.py b/diplomacy/daide/request_managers.py index 8e3e5cb..e4a5451 100644 --- a/diplomacy/daide/request_managers.py +++ b/diplomacy/daide/request_managers.py @@ -50,12 +50,7 @@ def on_name_request(server, request, connection_handler, game): connection_handler.token = None if not connection_handler.token: - user_exists = server.users.has_username(username) - - sign_in_request = internal_requests.SignIn(username=username, - password='1234', - create_user=not user_exists) - + sign_in_request = internal_requests.SignIn(username=username, password='1234') try: token_response = yield internal_request_managers.handle_request(server, sign_in_request, connection_handler) connection_handler.token = token_response.data @@ -119,10 +114,7 @@ def on_i_am_request(server, request, connection_handler, game): connection_handler.token = None if not connection_handler.token: - sign_in_request = internal_requests.SignIn(username=username, - password='1234', - create_user=False) - + sign_in_request = internal_requests.SignIn(username=username, password='1234') try: token_response = yield internal_request_managers.handle_request(server, sign_in_request, connection_handler) connection_handler.token = token_response.data diff --git a/diplomacy/daide/tests/test_daide_game.py b/diplomacy/daide/tests/test_daide_game.py index 3e970b2..93c73b7 100644 --- a/diplomacy/daide/tests/test_daide_game.py +++ b/diplomacy/daide/tests/test_daide_game.py @@ -390,17 +390,15 @@ def run_game_data(nb_daide_clients, rules, csv_file): # Creating human player human_username = 'username' human_password = 'password' - human_create_user = not server.users.has_user(human_username, human_password) # Creating bot player to play for dummy powers bot_username = constants.PRIVATE_BOT_USERNAME bot_password = constants.PRIVATE_BOT_PASSWORD - bot_create_user = not server.users.has_user(bot_username, bot_password) # Connecting connection = yield connect(HOSTNAME, port) - human_channel = yield connection.authenticate(human_username, human_password, human_create_user) - bot_channel = yield connection.authenticate(bot_username, bot_password, bot_create_user) + human_channel = yield connection.authenticate(human_username, human_password) + bot_channel = yield connection.authenticate(bot_username, bot_password) # Joining human to game channels = {BOT_KEYWORD: bot_channel} |