diff options
author | kali <kali@leap.se> | 2012-10-08 05:53:16 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-10-08 05:53:16 +0900 |
commit | 8a594577660d78a4f0f9d3c5f5902dff3911e010 (patch) | |
tree | fc5796d416cca97aa9cc0d34cb54af08cf5a600e /src/leap/gui/tests | |
parent | 9b025fe9972f686e40481d5eb03518e2fdac2d14 (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.py | 14 |
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) |