Fix brightbox tests
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/2195434b Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/2195434b Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/2195434b Branch: refs/heads/requests Commit: 2195434b94df4c221003a7ca98df4ffbf679aecb Parents: b164cfc Author: anthony-shaw <[email protected]> Authored: Wed Mar 30 15:53:42 2016 +1100 Committer: anthony-shaw <[email protected]> Committed: Wed Mar 30 15:53:42 2016 +1100 ---------------------------------------------------------------------- libcloud/test/loadbalancer/test_brightbox.py | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/2195434b/libcloud/test/loadbalancer/test_brightbox.py ---------------------------------------------------------------------- diff --git a/libcloud/test/loadbalancer/test_brightbox.py b/libcloud/test/loadbalancer/test_brightbox.py index ba95c64..7c1008d 100644 --- a/libcloud/test/loadbalancer/test_brightbox.py +++ b/libcloud/test/loadbalancer/test_brightbox.py @@ -97,36 +97,38 @@ class BrightboxLBMockHttp(MockHttpTestCase): def _token(self, method, url, body, headers): if method == 'POST': - return self.response(httplib.OK, self.fixtures.load('token.json')) + return (httplib.OK, self.fixtures.load('token.json'), {'content-type': 'application/json'}, + httplib.responses[httplib.OK]) def _1_0_load_balancers(self, method, url, body, headers): if method == 'GET': - return self.response(httplib.OK, - self.fixtures.load('load_balancers.json')) + return (httplib.OK, self.fixtures.load('load_balancers.json'), {'content-type': 'application/json'}, + httplib.responses[httplib.OK]) elif method == 'POST': body = self.fixtures.load('load_balancers_post.json') - return self.response(httplib.ACCEPTED, body) + return (httplib.ACCEPTED, body, {'content-type': 'application/json'}, + httplib.responses[httplib.ACCEPTED]) def _1_0_load_balancers_lba_1235f(self, method, url, body, headers): if method == 'GET': body = self.fixtures.load('load_balancers_lba_1235f.json') - return self.response(httplib.OK, body) + return (httplib.OK, body, {'content-type': 'application/json'}, + httplib.responses[httplib.OK]) elif method == 'DELETE': - return self.response(httplib.ACCEPTED, '') + return (httplib.ACCEPTED, '', {'content-type': 'application/json'}, + httplib.responses[httplib.ACCEPTED]) def _1_0_load_balancers_lba_1235f_add_nodes(self, method, url, body, headers): if method == 'POST': - return self.response(httplib.ACCEPTED, '') + return (httplib.ACCEPTED, '', {'content-type': 'application/json'}, + httplib.responses[httplib.ACCEPTED]) def _1_0_load_balancers_lba_1235f_remove_nodes(self, method, url, body, headers): if method == 'POST': - return self.response(httplib.ACCEPTED, '') - - def response(self, status, body): - return (status, body, {'content-type': 'application/json'}, - httplib.responses[status]) + return (httplib.ACCEPTED, '', {'content-type': 'application/json'}, + httplib.responses[httplib.ACCEPTED]) if __name__ == "__main__":
