summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/tests/unit/test_project.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-04-05 16:23:03 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-04-06 16:55:21 +0800
commitaa823fd3bbe42ead475217e2a5b947a636cf63dd (patch)
tree68e9e80dae6bb6325de2d8a839ee9d5fe6055ca6 /utils/test/testapi/opnfv_testapi/tests/unit/test_project.py
parent5412a1b30129d25b6f7f7de6c5262e2e3edc699b (diff)
unify error message in TestAPI
Change-Id: I994feb7bf340c9e48bebe9fdf3dc3a76bc254652 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/tests/unit/test_project.py')
-rw-r--r--utils/test/testapi/opnfv_testapi/tests/unit/test_project.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/test_project.py b/utils/test/testapi/opnfv_testapi/tests/unit/test_project.py
index 75b2d5260..74cefd711 100644
--- a/utils/test/testapi/opnfv_testapi/tests/unit/test_project.py
+++ b/utils/test/testapi/opnfv_testapi/tests/unit/test_project.py
@@ -9,6 +9,7 @@
import httplib
import unittest
+from opnfv_testapi.common import message
from opnfv_testapi.resources import project_models
import test_base as base
@@ -43,13 +44,13 @@ class TestProjectCreate(TestProjectBase):
req_empty = project_models.ProjectCreateRequest('')
(code, body) = self.create(req_empty)
self.assertEqual(code, httplib.BAD_REQUEST)
- self.assertIn('name missing', body)
+ self.assertIn(message.missing('name'), body)
def test_noneName(self):
req_none = project_models.ProjectCreateRequest(None)
(code, body) = self.create(req_none)
self.assertEqual(code, httplib.BAD_REQUEST)
- self.assertIn('name missing', body)
+ self.assertIn(message.missing('name'), body)
def test_success(self):
(code, body) = self.create_d()
@@ -60,7 +61,7 @@ class TestProjectCreate(TestProjectBase):
self.create_d()
(code, body) = self.create_d()
self.assertEqual(code, httplib.FORBIDDEN)
- self.assertIn('already exists', body)
+ self.assertIn(message.exist_base, body)
class TestProjectGet(TestProjectBase):
@@ -99,13 +100,13 @@ class TestProjectUpdate(TestProjectBase):
self.create_e()
code, body = self.update(self.req_e, self.req_d.name)
self.assertEqual(code, httplib.FORBIDDEN)
- self.assertIn("already exists", body)
+ self.assertIn(message.exist_base, body)
def test_noUpdate(self):
self.create_d()
code, body = self.update(self.req_d, self.req_d.name)
self.assertEqual(code, httplib.FORBIDDEN)
- self.assertIn("Nothing to update", body)
+ self.assertIn(message.no_update(), body)
def test_success(self):
self.create_d()