From 406e8996fb288e9851e02c3f3faa536a9919b28f Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 22 Feb 2016 16:10:09 +0900 Subject: [PATCH] Use 201 insted of 200 in PUT test case There are some unit test cases which assumes 200 as the response of PUT request, but 200 is never returned in PUT. This patch replaces 200 in PUT by 201, and adapt unit test cases to real case. Change-Id: I35fc7a4fe7fcc5558a9e6c6371105793c2710f3e --- test/unit/proxy/controllers/test_account.py | 32 +++++++++---------- test/unit/proxy/controllers/test_container.py | 32 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/test/unit/proxy/controllers/test_account.py b/test/unit/proxy/controllers/test_account.py index fd348b53a1..c7ef854d1b 100644 --- a/test/unit/proxy/controllers/test_account.py +++ b/test/unit/proxy/controllers/test_account.py @@ -261,12 +261,12 @@ class TestAccountController(unittest.TestCase): def test_response_code_for_PUT(self): PUT_TEST_CASES = [ - ((200, 200, 200), 200), - ((200, 200, 404), 200), - ((200, 200, 503), 200), - ((200, 404, 404), 404), - ((200, 404, 503), 503), - ((200, 503, 503), 503), + ((201, 201, 201), 201), + ((201, 201, 404), 201), + ((201, 201, 503), 201), + ((201, 404, 404), 404), + ((201, 404, 503), 503), + ((201, 503, 503), 503), ((404, 404, 404), 404), ((404, 404, 503), 404), ((404, 503, 503), 503), @@ -317,16 +317,16 @@ class TestAccountController4Replicas(TestAccountController): def test_response_code_for_PUT(self): PUT_TEST_CASES = [ - ((200, 200, 200, 200), 200), - ((200, 200, 200, 404), 200), - ((200, 200, 200, 503), 200), - ((200, 200, 404, 404), 503), - ((200, 200, 404, 503), 503), - ((200, 200, 503, 503), 503), - ((200, 404, 404, 404), 404), - ((200, 404, 404, 503), 503), - ((200, 404, 503, 503), 503), - ((200, 503, 503, 503), 503), + ((201, 201, 201, 201), 201), + ((201, 201, 201, 404), 201), + ((201, 201, 201, 503), 201), + ((201, 201, 404, 404), 503), + ((201, 201, 404, 503), 503), + ((201, 201, 503, 503), 503), + ((201, 404, 404, 404), 404), + ((201, 404, 404, 503), 503), + ((201, 404, 503, 503), 503), + ((201, 503, 503, 503), 503), ((404, 404, 404, 404), 404), ((404, 404, 404, 503), 404), ((404, 404, 503, 503), 503), diff --git a/test/unit/proxy/controllers/test_container.py b/test/unit/proxy/controllers/test_container.py index ce9a7d762a..afa89d1334 100644 --- a/test/unit/proxy/controllers/test_container.py +++ b/test/unit/proxy/controllers/test_container.py @@ -219,12 +219,12 @@ class TestContainerController(TestRingBase): def test_response_code_for_PUT(self): PUT_TEST_CASES = [ - ((200, 200, 200), 200), - ((200, 200, 404), 200), - ((200, 200, 503), 200), - ((200, 404, 404), 404), - ((200, 404, 503), 503), - ((200, 503, 503), 503), + ((201, 201, 201), 201), + ((201, 201, 404), 201), + ((201, 201, 503), 201), + ((201, 404, 404), 404), + ((201, 404, 503), 503), + ((201, 503, 503), 503), ((404, 404, 404), 404), ((404, 404, 503), 404), ((404, 503, 503), 503), @@ -304,16 +304,16 @@ class TestContainerController4Replicas(TestContainerController): def test_response_code_for_PUT(self): PUT_TEST_CASES = [ - ((200, 200, 200, 200), 200), - ((200, 200, 200, 404), 200), - ((200, 200, 200, 503), 200), - ((200, 200, 404, 404), 503), - ((200, 200, 404, 503), 503), - ((200, 200, 503, 503), 503), - ((200, 404, 404, 404), 404), - ((200, 404, 404, 503), 503), - ((200, 404, 503, 503), 503), - ((200, 503, 503, 503), 503), + ((201, 201, 201, 201), 201), + ((201, 201, 201, 404), 201), + ((201, 201, 201, 503), 201), + ((201, 201, 404, 404), 503), + ((201, 201, 404, 503), 503), + ((201, 201, 503, 503), 503), + ((201, 404, 404, 404), 404), + ((201, 404, 404, 503), 503), + ((201, 404, 503, 503), 503), + ((201, 503, 503, 503), 503), ((404, 404, 404, 404), 404), ((404, 404, 404, 503), 404), ((404, 404, 503, 503), 503),