From fc9f9d7baebfa98cdbd9fbe8289e82268ab5e149 Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Tue, 29 Oct 2013 16:10:47 -0600 Subject: [PATCH] Strengthen account tests This fell out of Peter Portante's "acctcont-api" branch and seems obviously good. Apparently one of these would've triggered while doing the Pluggable Backend work. Now, why commit this separately while simultaneously working on a big unified Backend Patch? Because posting them separately proves that the test changes worked on the old code. Change-Id: I9ca6ad45fb255f5c0a177a93b93c1acc68da5bbe --- test/unit/account/test_server.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/unit/account/test_server.py b/test/unit/account/test_server.py index 81bf6c15a7..748c3173c6 100644 --- a/test/unit/account/test_server.py +++ b/test/unit/account/test_server.py @@ -458,10 +458,12 @@ class TestAccountController(unittest.TestCase): def test_POST_after_DELETE_not_found(self): req = Request.blank('/sda1/p/a', environ={'REQUEST_METHOD': 'PUT', 'HTTP_X_TIMESTAMP': '0'}) - req.get_response(self.controller) + resp = req.get_response(self.controller) + self.assertEquals(resp.status_int, 201) req = Request.blank('/sda1/p/a', environ={'REQUEST_METHOD': 'DELETE', 'HTTP_X_TIMESTAMP': '1'}) resp = req.get_response(self.controller) + self.assertEquals(resp.status_int, 204) req = Request.blank('/sda1/p/a', environ={'REQUEST_METHOD': 'POST', 'HTTP_X_TIMESTAMP': '2'}) resp = req.get_response(self.controller) @@ -952,7 +954,8 @@ class TestAccountController(unittest.TestCase): def test_GET_accept_application_wildcard(self): req = Request.blank('/sda1/p/a', environ={'REQUEST_METHOD': 'PUT', 'HTTP_X_TIMESTAMP': '0'}) - req.get_response(self.controller) + resp = req.get_response(self.controller) + self.assertEquals(resp.status_int, 201) req = Request.blank('/sda1/p/a/c1', environ={'REQUEST_METHOD': 'PUT'}, headers={'X-Put-Timestamp': '1', 'X-Delete-Timestamp': '0', @@ -960,6 +963,7 @@ class TestAccountController(unittest.TestCase): 'X-Bytes-Used': '0', 'X-Timestamp': normalize_timestamp(0)}) resp = req.get_response(self.controller) + self.assertEquals(resp.status_int, 201) req = Request.blank('/sda1/p/a', environ={'REQUEST_METHOD': 'GET'}) req.accept = 'application/*' resp = req.get_response(self.controller) @@ -1356,7 +1360,7 @@ class TestAccountController(unittest.TestCase): self.assertEqual(resp.status_int, 204, "%d on param %s" % (resp.status_int, param)) - def test_put_auto_create(self): + def test_PUT_auto_create(self): headers = {'x-put-timestamp': normalize_timestamp(1), 'x-delete-timestamp': normalize_timestamp(0), 'x-object-count': '0',