4 from api import ApiResource
5 from yardstick.common.utils import result_handler
6 from yardstick.common import constants as consts
8 LOG = logging.getLogger(__name__)
9 LOG.setLevel(logging.DEBUG)
12 class V2Testcases(ApiResource):
15 return self._dispatch_post()
17 def upload_case(self, args):
19 upload_file = args['file']
21 return result_handler(consts.API_ERROR, 'file must be provided')
23 case_name = os.path.join(consts.TESTCASE_DIR, upload_file.filename)
25 LOG.info('save case file')
26 upload_file.save(case_name)
28 return result_handler(consts.API_SUCCESS, {'testcase': upload_file.filename})