1 ##############################################################################
2 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
11 from tornado.escape import json_encode
13 from api.handlers import BaseHandler
17 class TestCases(BaseHandler):
18 def get(self, project):
21 url = '{}/projects/{}/cases'.format(conf.base_url, project)
22 cases = requests.get(url).json().get('testcases', [])
23 data = [t['name'] for t in cases]
24 self.write(json_encode(data))
27 class TestCase(BaseHandler):
28 def get(self, project, name):
31 url = '{}/projects/{}/cases/{}'.format(conf.base_url, project, name)
32 data = requests.get(url).json()
33 self.write(json_encode(data))