diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2018-02-27 09:44:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-02-27 09:44:45 +0000 |
commit | 3178bbeebb22f94eb66f31152ed314dacbf5a1de (patch) | |
tree | 3a51ebe8d5138fef87b0cf47396af23094801ca4 /testapi/opnfv_testapi/tests | |
parent | 04abc1dc89e2b471a170fe6160fa6f8535d59bd8 (diff) | |
parent | c3e868997d30bb907aca48abdb99b2ada2f70c1c (diff) |
Merge "remove deprecated upload-related codes"
Diffstat (limited to 'testapi/opnfv_testapi/tests')
-rw-r--r-- | testapi/opnfv_testapi/tests/unit/executor.py | 14 | ||||
-rw-r--r-- | testapi/opnfv_testapi/tests/unit/handlers/test_result.py | 39 |
2 files changed, 0 insertions, 53 deletions
diff --git a/testapi/opnfv_testapi/tests/unit/executor.py b/testapi/opnfv_testapi/tests/unit/executor.py index 743c076..d08782c 100644 --- a/testapi/opnfv_testapi/tests/unit/executor.py +++ b/testapi/opnfv_testapi/tests/unit/executor.py @@ -43,20 +43,6 @@ def mock_valid_lfid(): return _mock_valid_lfid -def upload(excepted_status, excepted_response): - def _upload(create_request): - @functools.wraps(create_request) - def wrap(self): - request = create_request(self) - status, body = self.upload(request) - if excepted_status == httplib.OK: - getattr(self, excepted_response)(body) - else: - self.assertIn(excepted_response, body) - return wrap - return _upload - - def create(excepted_status, excepted_response): def _create(create_request): @functools.wraps(create_request) diff --git a/testapi/opnfv_testapi/tests/unit/handlers/test_result.py b/testapi/opnfv_testapi/tests/unit/handlers/test_result.py index f1f055e..c07d792 100644 --- a/testapi/opnfv_testapi/tests/unit/handlers/test_result.py +++ b/testapi/opnfv_testapi/tests/unit/handlers/test_result.py @@ -10,7 +10,6 @@ import copy from datetime import datetime from datetime import timedelta import httplib -import json import urllib from opnfv_testapi.common import message @@ -46,22 +45,6 @@ class TestResultBase(base.TestBase): _, res = self.create_d() return res.href.split('/')[-1] - def upload(self, req): - if req and not isinstance(req, str) and hasattr(req, 'format'): - req = req.format() - res = self.fetch(self.basePath + '/upload', - method='POST', - body=json.dumps(req), - headers=self.headers) - - return self._get_return(res, self.create_res) - - -class TestResultUpload(TestResultBase): - @executor.upload(httplib.BAD_REQUEST, message.key_error('file')) - def test_filenotfind(self): - return None - class TestResultCreate(TestResultBase): @executor.create(httplib.BAD_REQUEST, message.no_body()) @@ -197,16 +180,6 @@ class TestResultGet(TestResultBase): def test_queryLast(self): return self._set_query(last=1) - @executor.query(httplib.OK, '_query_success', 4) - def test_queryPublic(self): - self._create_public_data() - return self._set_query() - - @executor.query(httplib.OK, '_query_success', 1) - def test_queryPrivate(self): - self._create_private_data() - return self._set_query(public='false') - @executor.query(httplib.OK, '_query_period_one', 1) def test_combination(self): return self._set_query('pod', @@ -266,18 +239,6 @@ class TestResultGet(TestResultBase): self.create(req) return req - def _create_public_data(self, **kwargs): - req = copy.deepcopy(self.req_d) - req.public = 'true' - self.create(req) - return req - - def _create_private_data(self, **kwargs): - req = copy.deepcopy(self.req_d) - req.public = 'false' - self.create(req) - return req - def _set_query(self, *args, **kwargs): def get_value(arg): if arg in ['pod', 'project', 'case']: |