Commit 656e2ff0 by Sheng

Tested default port

parent 0c9db2ab
...@@ -153,6 +153,28 @@ class TestAppBasic(AsyncHTTPTestCase): ...@@ -153,6 +153,28 @@ class TestAppBasic(AsyncHTTPTestCase):
self.assertIsNotNone(data['id']) self.assertIsNotNone(data['id'])
self.assertIsNotNone(data['encoding']) self.assertIsNotNone(data['encoding'])
def test_app_with_correct_credentials_but_with_no_port(self):
default_port = handler.DEFAULT_PORT
handler.DEFAULT_PORT = self.sshserver_port
# with no port value
body = self.body.replace(str(self.sshserver_port), '')
response = self.sync_post(body)
data = json.loads(to_str(response.body))
self.assertIsNone(data['status'])
self.assertIsNotNone(data['id'])
self.assertIsNotNone(data['encoding'])
# with no port argument
body = body.replace('port=&', '')
response = self.sync_post(body)
data = json.loads(to_str(response.body))
self.assertIsNone(data['status'])
self.assertIsNotNone(data['id'])
self.assertIsNotNone(data['encoding'])
handler.DEFAULT_PORT = default_port
@tornado.testing.gen_test @tornado.testing.gen_test
def test_app_with_correct_credentials_timeout(self): def test_app_with_correct_credentials_timeout(self):
url = self.get_url('/') url = self.get_url('/')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment