From b0ea9f285943bcbea3dd14fe3c5f8aa63db937a8 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Wed, 16 Sep 2015 10:11:43 -0400 Subject: [PATCH] Fix tests for server mode. --- moto/datapipeline/responses.py | 6 +++++- tests/test_datapipeline/test_server.py | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/moto/datapipeline/responses.py b/moto/datapipeline/responses.py index a61ec2514..273543329 100644 --- a/moto/datapipeline/responses.py +++ b/moto/datapipeline/responses.py @@ -10,7 +10,11 @@ class DataPipelineResponse(BaseResponse): @property def parameters(self): - return json.loads(self.body.decode("utf-8")) + # TODO this should really be moved to core/responses.py + if self.body: + return json.loads(self.body.decode("utf-8")) + else: + return self.querystring @property def datapipeline_backend(self): diff --git a/tests/test_datapipeline/test_server.py b/tests/test_datapipeline/test_server.py index 0ff03aa8d..33a19c6f0 100644 --- a/tests/test_datapipeline/test_server.py +++ b/tests/test_datapipeline/test_server.py @@ -16,10 +16,12 @@ def test_list_streams(): backend = server.create_backend_app("datapipeline") test_client = backend.test_client() - res = test_client.get('/?Action=ListStreams') + res = test_client.post('/', + data={"pipelineIds": ["ASdf"]}, + headers={"X-Amz-Target": "DataPipeline.DescribePipelines"}, + ) json_data = json.loads(res.data.decode("utf-8")) json_data.should.equal({ - "HasMoreStreams": False, - "StreamNames": [], + 'PipelineDescriptionList': [] })