fix cloudstack lb tests, gogrid tests and s3 tests
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/da0a40e0 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/da0a40e0 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/da0a40e0 Branch: refs/heads/trunk Commit: da0a40e003a88883d1e33b97499fbb6ef1eecef5 Parents: f33c126 Author: Anthony Shaw <anthonys...@apache.org> Authored: Wed Apr 12 10:49:22 2017 +1000 Committer: Anthony Shaw <anthonys...@apache.org> Committed: Wed Apr 12 10:49:22 2017 +1000 ---------------------------------------------------------------------- libcloud/test/__init__.py | 3 +-- libcloud/test/common/test_cloudstack.py | 2 +- libcloud/test/loadbalancer/test_cloudstack.py | 2 +- libcloud/test/loadbalancer/test_gogrid.py | 2 +- libcloud/test/storage/test_s3.py | 3 ++- 5 files changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/da0a40e0/libcloud/test/__init__.py ---------------------------------------------------------------------- diff --git a/libcloud/test/__init__.py b/libcloud/test/__init__.py index 3d0ec17..ef8c340 100644 --- a/libcloud/test/__init__.py +++ b/libcloud/test/__init__.py @@ -116,7 +116,7 @@ class MockHttp(LibcloudConnection): unittest.TestCase.__init__(self, '__init__') super(MockHttp, self).__init__(*args, **kwargs) - def _get_request(self, method, url, body=None, headers=None, raw=False, stream=False): + def _get_request(self, method, url, body=None, headers=None): # Find a method we can use for this request parsed = urlparse.urlparse(url) _, _, path, _, query, _ = parsed @@ -131,7 +131,6 @@ class MockHttp(LibcloudConnection): if self.test and isinstance(self.test, LibcloudTestCase): self.test._add_visited_url(url=url) self.test._add_executed_mock_method(method_name=meth_name) - return meth(method, url, body, headers) def request(self, method, url, body=None, headers=None, raw=False, stream=False): http://git-wip-us.apache.org/repos/asf/libcloud/blob/da0a40e0/libcloud/test/common/test_cloudstack.py ---------------------------------------------------------------------- diff --git a/libcloud/test/common/test_cloudstack.py b/libcloud/test/common/test_cloudstack.py index 28815e1..a0c1f4b 100644 --- a/libcloud/test/common/test_cloudstack.py +++ b/libcloud/test/common/test_cloudstack.py @@ -124,7 +124,7 @@ class CloudStackCommonTest(unittest.TestCase): self.assertEqual(connection._make_signature(params), b(case[1])) -class CloudStackMockHttp(MockHttp): +class CloudStackMockHttp(MockHttp, unittest.TestCase): ERROR_TEXT = 'ERROR TEXT' http://git-wip-us.apache.org/repos/asf/libcloud/blob/da0a40e0/libcloud/test/loadbalancer/test_cloudstack.py ---------------------------------------------------------------------- diff --git a/libcloud/test/loadbalancer/test_cloudstack.py b/libcloud/test/loadbalancer/test_cloudstack.py index e70110e..76f9e65 100644 --- a/libcloud/test/loadbalancer/test_cloudstack.py +++ b/libcloud/test/loadbalancer/test_cloudstack.py @@ -86,7 +86,7 @@ class CloudStackLBTests(unittest.TestCase): self.assertEqual(member.balancer, balancer) -class CloudStackMockHttp(MockHttp): +class CloudStackMockHttp(MockHttp, unittest.TestCase): fixtures = LoadBalancerFileFixtures('cloudstack') fixture_tag = 'default' http://git-wip-us.apache.org/repos/asf/libcloud/blob/da0a40e0/libcloud/test/loadbalancer/test_gogrid.py ---------------------------------------------------------------------- diff --git a/libcloud/test/loadbalancer/test_gogrid.py b/libcloud/test/loadbalancer/test_gogrid.py index 4d70a02..f01a28a 100644 --- a/libcloud/test/loadbalancer/test_gogrid.py +++ b/libcloud/test/loadbalancer/test_gogrid.py @@ -154,7 +154,7 @@ class GoGridTests(unittest.TestCase): self.assertTrue(ret2) -class GoGridLBMockHttp(MockHttp): +class GoGridLBMockHttp(MockHttp, unittest.TestCase): fixtures = LoadBalancerFileFixtures('gogrid') def _api_grid_loadbalancer_list(self, method, url, body, headers): http://git-wip-us.apache.org/repos/asf/libcloud/blob/da0a40e0/libcloud/test/storage/test_s3.py ---------------------------------------------------------------------- diff --git a/libcloud/test/storage/test_s3.py b/libcloud/test/storage/test_s3.py index 3b8cef3..10fa0a0 100644 --- a/libcloud/test/storage/test_s3.py +++ b/libcloud/test/storage/test_s3.py @@ -224,7 +224,7 @@ class S3MockHttp(MockHttp): headers, httplib.responses[httplib.OK]) - def _foo_bar_container_foo_bar_object(self, method, url, body, headers): + def _foo_bar_container_foo_bar_object_DELETE(self, method, url, body, headers): # test_delete_object return (httplib.NO_CONTENT, body, @@ -947,6 +947,7 @@ class S3Tests(unittest.TestCase): self.fail('Exception was not thrown') def test_delete_object_success(self): + self.mock_response_klass.type = 'DELETE' container = Container(name='foo_bar_container', extra={}, driver=self.driver) obj = Object(name='foo_bar_object', size=1234, hash=None, extra=None,