Skip to content

Commit

Permalink
Let unit test happy
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <xuanwo@yunify.com>
  • Loading branch information
Xuanwo committed Sep 5, 2017
1 parent 92d5fa9 commit 8415121
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions tests/client/test_upload_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class MockResponse(dict):

def __init__(self, **kwargs):
super(MockResponse, self).__init__()
self.__dict__ = self
Expand All @@ -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
Expand All @@ -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(
Expand All @@ -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))
Expand Down

0 comments on commit 8415121

Please sign in to comment.