# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
class TestPodCreate(TestPodBase):
def test_withoutBody(self):
(code, body) = self.create()
class TestPodCreate(TestPodBase):
def test_withoutBody(self):
(code, body) = self.create()
def test_emptyName(self):
req_empty = pod_models.PodCreateRequest('')
(code, body) = self.create(req_empty)
def test_emptyName(self):
req_empty = pod_models.PodCreateRequest('')
(code, body) = self.create(req_empty)
- self.assertEqual(code, constants.HTTP_BAD_REQUEST)
- self.assertIn('name missing', body)
+ self.assertEqual(code, httplib.BAD_REQUEST)
+ self.assertIn(message.missing('name'), body)
def test_noneName(self):
req_none = pod_models.PodCreateRequest(None)
(code, body) = self.create(req_none)
def test_noneName(self):
req_none = pod_models.PodCreateRequest(None)
(code, body) = self.create(req_none)
- self.assertEqual(code, constants.HTTP_BAD_REQUEST)
- self.assertIn('name missing', body)
+ self.assertEqual(code, httplib.BAD_REQUEST)
+ self.assertIn(message.missing('name'), body)
self.assert_create_body(body)
def test_alreadyExist(self):
self.create_d()
code, body = self.create_d()
self.assert_create_body(body)
def test_alreadyExist(self):
self.create_d()
code, body = self.create_d()
- self.assertEqual(code, constants.HTTP_FORBIDDEN)
- self.assertIn('already exists', body)
+ self.assertEqual(code, httplib.FORBIDDEN)
+ self.assertIn(message.exist_base, body)
class TestPodGet(TestPodBase):
def test_notExist(self):
code, body = self.get('notExist')
class TestPodGet(TestPodBase):
def test_notExist(self):
code, body = self.get('notExist')