apiserver: add interface /api/token

This commit is contained in:
httprunner
2017-06-28 22:19:01 +08:00
parent 4f87c14f53
commit a2bf2f6ee1
3 changed files with 26 additions and 0 deletions

View File

@@ -128,3 +128,10 @@ class TestApiServer(ApiServerUnittest):
resp = self.api_client.post(url, json=expected_response)
self.assertIn('abc', resp.headers)
self.assertIn('123', resp.headers['abc'])
def test_get_token(self):
url = "%s/api/token" % self.host
resp = self.api_client.get(url)
resp_json = resp.json()
self.assertTrue(resp_json["success"])
self.assertEqual(len(resp_json["token"]), 8)