|
|
|
@ -62,8 +62,7 @@ class LoginRestServletTestCase(unittest.HomeserverTestCase): |
|
|
|
|
"identifier": {"type": "m.id.user", "user": "kermit" + str(i)}, |
|
|
|
|
"password": "monkey", |
|
|
|
|
} |
|
|
|
|
request_data = json.dumps(params) |
|
|
|
|
request, channel = self.make_request(b"POST", LOGIN_URL, request_data) |
|
|
|
|
request, channel = self.make_request(b"POST", LOGIN_URL, params) |
|
|
|
|
self.render(request) |
|
|
|
|
|
|
|
|
|
if i == 5: |
|
|
|
@ -76,14 +75,13 @@ class LoginRestServletTestCase(unittest.HomeserverTestCase): |
|
|
|
|
# than 1min. |
|
|
|
|
self.assertTrue(retry_after_ms < 6000) |
|
|
|
|
|
|
|
|
|
self.reactor.advance(retry_after_ms / 1000.0) |
|
|
|
|
self.reactor.advance(retry_after_ms / 1000.0 + 1.0) |
|
|
|
|
|
|
|
|
|
params = { |
|
|
|
|
"type": "m.login.password", |
|
|
|
|
"identifier": {"type": "m.id.user", "user": "kermit" + str(i)}, |
|
|
|
|
"password": "monkey", |
|
|
|
|
} |
|
|
|
|
request_data = json.dumps(params) |
|
|
|
|
request, channel = self.make_request(b"POST", LOGIN_URL, params) |
|
|
|
|
self.render(request) |
|
|
|
|
|
|
|
|
@ -111,8 +109,7 @@ class LoginRestServletTestCase(unittest.HomeserverTestCase): |
|
|
|
|
"identifier": {"type": "m.id.user", "user": "kermit"}, |
|
|
|
|
"password": "monkey", |
|
|
|
|
} |
|
|
|
|
request_data = json.dumps(params) |
|
|
|
|
request, channel = self.make_request(b"POST", LOGIN_URL, request_data) |
|
|
|
|
request, channel = self.make_request(b"POST", LOGIN_URL, params) |
|
|
|
|
self.render(request) |
|
|
|
|
|
|
|
|
|
if i == 5: |
|
|
|
@ -132,7 +129,6 @@ class LoginRestServletTestCase(unittest.HomeserverTestCase): |
|
|
|
|
"identifier": {"type": "m.id.user", "user": "kermit"}, |
|
|
|
|
"password": "monkey", |
|
|
|
|
} |
|
|
|
|
request_data = json.dumps(params) |
|
|
|
|
request, channel = self.make_request(b"POST", LOGIN_URL, params) |
|
|
|
|
self.render(request) |
|
|
|
|
|
|
|
|
@ -160,8 +156,7 @@ class LoginRestServletTestCase(unittest.HomeserverTestCase): |
|
|
|
|
"identifier": {"type": "m.id.user", "user": "kermit"}, |
|
|
|
|
"password": "notamonkey", |
|
|
|
|
} |
|
|
|
|
request_data = json.dumps(params) |
|
|
|
|
request, channel = self.make_request(b"POST", LOGIN_URL, request_data) |
|
|
|
|
request, channel = self.make_request(b"POST", LOGIN_URL, params) |
|
|
|
|
self.render(request) |
|
|
|
|
|
|
|
|
|
if i == 5: |
|
|
|
@ -174,14 +169,13 @@ class LoginRestServletTestCase(unittest.HomeserverTestCase): |
|
|
|
|
# than 1min. |
|
|
|
|
self.assertTrue(retry_after_ms < 6000) |
|
|
|
|
|
|
|
|
|
self.reactor.advance(retry_after_ms / 1000.0) |
|
|
|
|
self.reactor.advance(retry_after_ms / 1000.0 + 1.0) |
|
|
|
|
|
|
|
|
|
params = { |
|
|
|
|
"type": "m.login.password", |
|
|
|
|
"identifier": {"type": "m.id.user", "user": "kermit"}, |
|
|
|
|
"password": "notamonkey", |
|
|
|
|
} |
|
|
|
|
request_data = json.dumps(params) |
|
|
|
|
request, channel = self.make_request(b"POST", LOGIN_URL, params) |
|
|
|
|
self.render(request) |
|
|
|
|
|
|
|
|
|