summaryrefslogtreecommitdiffstats
path: root/testapi
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-07-12 14:27:58 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-07-12 14:27:58 +0800
commitd43c5992199b99c738a74d22ad126e86153d1008 (patch)
treef468ff77b161bf2dadf4728fcf8e40ae3d81c021 /testapi
parent5eb90d88748ee25c0d1a858167d435a9498d175c (diff)
move resources unit tests to tests/unit/resources
As webportal is introduced, the project structure is becoming more complex, it is time to make it a a little bit more official Change-Id: Id380d37b07719f053b0bd385a326a2f2944a4b22 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi')
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/__init__.py0
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/scenario-c1.json (renamed from testapi/opnfv_testapi/tests/unit/scenario-c1.json)0
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/scenario-c2.json (renamed from testapi/opnfv_testapi/tests/unit/scenario-c2.json)0
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_base.py (renamed from testapi/opnfv_testapi/tests/unit/test_base.py)4
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_fake_pymongo.py (renamed from testapi/opnfv_testapi/tests/unit/test_fake_pymongo.py)0
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_pod.py (renamed from testapi/opnfv_testapi/tests/unit/test_pod.py)2
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_project.py (renamed from testapi/opnfv_testapi/tests/unit/test_project.py)2
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_result.py (renamed from testapi/opnfv_testapi/tests/unit/test_result.py)4
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_scenario.py (renamed from testapi/opnfv_testapi/tests/unit/test_scenario.py)8
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_testcase.py (renamed from testapi/opnfv_testapi/tests/unit/test_testcase.py)2
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_token.py (renamed from testapi/opnfv_testapi/tests/unit/test_token.py)2
-rw-r--r--testapi/opnfv_testapi/tests/unit/resources/test_version.py (renamed from testapi/opnfv_testapi/tests/unit/test_version.py)2
12 files changed, 13 insertions, 13 deletions
diff --git a/testapi/opnfv_testapi/tests/unit/resources/__init__.py b/testapi/opnfv_testapi/tests/unit/resources/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/testapi/opnfv_testapi/tests/unit/resources/__init__.py
diff --git a/testapi/opnfv_testapi/tests/unit/scenario-c1.json b/testapi/opnfv_testapi/tests/unit/resources/scenario-c1.json
index 1878022..1878022 100644
--- a/testapi/opnfv_testapi/tests/unit/scenario-c1.json
+++ b/testapi/opnfv_testapi/tests/unit/resources/scenario-c1.json
diff --git a/testapi/opnfv_testapi/tests/unit/scenario-c2.json b/testapi/opnfv_testapi/tests/unit/resources/scenario-c2.json
index b6a3b83..b6a3b83 100644
--- a/testapi/opnfv_testapi/tests/unit/scenario-c2.json
+++ b/testapi/opnfv_testapi/tests/unit/resources/scenario-c2.json
diff --git a/testapi/opnfv_testapi/tests/unit/test_base.py b/testapi/opnfv_testapi/tests/unit/resources/test_base.py
index 4d34456..6e4d454 100644
--- a/testapi/opnfv_testapi/tests/unit/test_base.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_base.py
@@ -17,7 +17,7 @@ from opnfv_testapi.resources import models
from opnfv_testapi.tests.unit import fake_pymongo
config.Config.CONFIG = path.join(path.dirname(__file__),
- '../../../etc/config.ini')
+ '../../../../etc/config.ini')
class TestBase(testing.AsyncHTTPTestCase):
@@ -42,7 +42,7 @@ class TestBase(testing.AsyncHTTPTestCase):
from opnfv_testapi.cmd import server
server.parse_config([
'--config-file',
- path.join(path.dirname(__file__), 'common/normal.ini')
+ path.join(path.dirname(__file__), path.pardir, 'common/normal.ini')
])
self.db_patcher = mock.patch('opnfv_testapi.cmd.server.get_db',
self._fake_pymongo)
diff --git a/testapi/opnfv_testapi/tests/unit/test_fake_pymongo.py b/testapi/opnfv_testapi/tests/unit/resources/test_fake_pymongo.py
index 1ebc96f..1ebc96f 100644
--- a/testapi/opnfv_testapi/tests/unit/test_fake_pymongo.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_fake_pymongo.py
diff --git a/testapi/opnfv_testapi/tests/unit/test_pod.py b/testapi/opnfv_testapi/tests/unit/resources/test_pod.py
index 0ed348d..8e0ae40 100644
--- a/testapi/opnfv_testapi/tests/unit/test_pod.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_pod.py
@@ -12,7 +12,7 @@ import unittest
from opnfv_testapi.common import message
from opnfv_testapi.resources import pod_models
from opnfv_testapi.tests.unit import executor
-from opnfv_testapi.tests.unit import test_base as base
+from opnfv_testapi.tests.unit.resources import test_base as base
class TestPodBase(base.TestBase):
diff --git a/testapi/opnfv_testapi/tests/unit/test_project.py b/testapi/opnfv_testapi/tests/unit/resources/test_project.py
index 323a116..5a2ce75 100644
--- a/testapi/opnfv_testapi/tests/unit/test_project.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_project.py
@@ -4,7 +4,7 @@ import unittest
from opnfv_testapi.common import message
from opnfv_testapi.resources import project_models
from opnfv_testapi.tests.unit import executor
-from opnfv_testapi.tests.unit import test_base as base
+from opnfv_testapi.tests.unit.resources import test_base as base
class TestProjectBase(base.TestBase):
diff --git a/testapi/opnfv_testapi/tests/unit/test_result.py b/testapi/opnfv_testapi/tests/unit/resources/test_result.py
index ef2ce30..c8463cb 100644
--- a/testapi/opnfv_testapi/tests/unit/test_result.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_result.py
@@ -7,17 +7,17 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
import copy
-from datetime import datetime, timedelta
import httplib
import unittest
+from datetime import datetime, timedelta
from opnfv_testapi.common import message
from opnfv_testapi.resources import pod_models
from opnfv_testapi.resources import project_models
from opnfv_testapi.resources import result_models
from opnfv_testapi.resources import testcase_models
-from opnfv_testapi.tests.unit import test_base as base
from opnfv_testapi.tests.unit import executor
+from opnfv_testapi.tests.unit.resources import test_base as base
class Details(object):
diff --git a/testapi/opnfv_testapi/tests/unit/test_scenario.py b/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py
index b232bc1..bd72067 100644
--- a/testapi/opnfv_testapi/tests/unit/test_scenario.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_scenario.py
@@ -1,13 +1,13 @@
-from copy import deepcopy
-from datetime import datetime
import functools
import httplib
import json
import os
+from copy import deepcopy
+from datetime import datetime
-from opnfv_testapi.common import message
import opnfv_testapi.resources.scenario_models as models
-from opnfv_testapi.tests.unit import test_base as base
+from opnfv_testapi.common import message
+from opnfv_testapi.tests.unit.resources import test_base as base
class TestScenarioBase(base.TestBase):
diff --git a/testapi/opnfv_testapi/tests/unit/test_testcase.py b/testapi/opnfv_testapi/tests/unit/resources/test_testcase.py
index e28eaf5..4f2bc2a 100644
--- a/testapi/opnfv_testapi/tests/unit/test_testcase.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_testcase.py
@@ -13,8 +13,8 @@ import unittest
from opnfv_testapi.common import message
from opnfv_testapi.resources import project_models
from opnfv_testapi.resources import testcase_models
-from opnfv_testapi.tests.unit import test_base as base
from opnfv_testapi.tests.unit import executor
+from opnfv_testapi.tests.unit.resources import test_base as base
class TestCaseBase(base.TestBase):
diff --git a/testapi/opnfv_testapi/tests/unit/test_token.py b/testapi/opnfv_testapi/tests/unit/resources/test_token.py
index ca247a3..c9d4b72 100644
--- a/testapi/opnfv_testapi/tests/unit/test_token.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_token.py
@@ -13,7 +13,7 @@ from opnfv_testapi.resources import project_models
from opnfv_testapi.router import url_mappings
from opnfv_testapi.tests.unit import executor
from opnfv_testapi.tests.unit import fake_pymongo
-from opnfv_testapi.tests.unit import test_base as base
+from opnfv_testapi.tests.unit.resources import test_base as base
class TestToken(base.TestBase):
diff --git a/testapi/opnfv_testapi/tests/unit/test_version.py b/testapi/opnfv_testapi/tests/unit/resources/test_version.py
index fff802a..51fed11 100644
--- a/testapi/opnfv_testapi/tests/unit/test_version.py
+++ b/testapi/opnfv_testapi/tests/unit/resources/test_version.py
@@ -11,7 +11,7 @@ import unittest
from opnfv_testapi.resources import models
from opnfv_testapi.tests.unit import executor
-from opnfv_testapi.tests.unit import test_base as base
+from opnfv_testapi.tests.unit.resources import test_base as base
class TestVersionBase(base.TestBase):