From 84151216da5fb14b88f8e2c18b07e0d158e65242 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Tue, 5 Sep 2017 13:01:51 +0800 Subject: [PATCH] Let unit test happy Signed-off-by: Xuanwo --- tests/client/test_upload_client.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/client/test_upload_client.py b/tests/client/test_upload_client.py index cc830d8..fe17047 100644 --- a/tests/client/test_upload_client.py +++ b/tests/client/test_upload_client.py @@ -10,7 +10,6 @@ class MockResponse(dict): - def __init__(self, **kwargs): super(MockResponse, self).__init__() self.__dict__ = self @@ -20,7 +19,6 @@ def __init__(self, **kwargs): class MockBucket(Bucket, object): - def __init__(self, ok): super(MockBucket, self).__init__(None, None, None) self.ok = ok @@ -35,10 +33,7 @@ def complete_multipart_upload(self, *args, **kwargs): return MockResponse(ok=self.ok, **kwargs) def abort_multipart_upload(self, *args, **kwargs): - if self.ok: - return MockResponse(status_code=400, **kwargs) - else: - return MockResponse(status_code=500, **kwargs) + return MockResponse(ok=self.ok, **kwargs) def list_multipart(self, *args, **kwargs): return MockResponse( @@ -53,7 +48,6 @@ def list_multipart(self, *args, **kwargs): class TestUploadClient(unittest.TestCase): - @classmethod def setUpClass(cls): cls.ok_upload_client = UploadClient(MockBucket(True))