summaryrefslogtreecommitdiff
path: root/src/leap/gui/tests
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-08 05:53:16 +0900
committerkali <kali@leap.se>2012-10-08 05:53:16 +0900
commit8a594577660d78a4f0f9d3c5f5902dff3911e010 (patch)
treefc5796d416cca97aa9cc0d34cb54af08cf5a600e /src/leap/gui/tests
parent9b025fe9972f686e40481d5eb03518e2fdac2d14 (diff)
catch timeout and specify kind of signup error
Diffstat (limited to 'src/leap/gui/tests')
-rw-r--r--src/leap/gui/tests/integration/fake_user_signup.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/leap/gui/tests/integration/fake_user_signup.py b/src/leap/gui/tests/integration/fake_user_signup.py
index e46ff349..12f18966 100644
--- a/src/leap/gui/tests/integration/fake_user_signup.py
+++ b/src/leap/gui/tests/integration/fake_user_signup.py
@@ -23,7 +23,8 @@ LOGIN_ERROR = """{"errors":{"login":["has already been taken"]}}"""
class request_handler(BaseHTTPRequestHandler):
responses = {
'/': ['ok\n'],
- '/users.json': ['ok\n']
+ '/users.json': ['ok\n'],
+ '/timeout': ['ok\n']
}
def do_GET(self):
@@ -47,12 +48,21 @@ class request_handler(BaseHTTPRequestHandler):
path = urlparse.urlparse(self.path)
message = '\n'.join(
self.responses.get(
- path.path, None))
+ path.path, ''))
login = data.get('login', None)
#password_salt = data.get('password_salt', None)
#password_verifier = data.get('password_verifier', None)
+ if path.geturl() == "/timeout":
+ print 'timeout'
+ self.send_response(200)
+ self.end_headers()
+ self.wfile.write(message)
+ import time
+ time.sleep(10)
+ return
+
ok = True if (login == "python_test_user") else False
if ok:
self.send_response(200)