Change data pipeline responses to start with lowercase characters

This commit is contained in:
Hugo Lopes Tavares 2015-09-17 15:18:57 -04:00
parent 66dce44214
commit 8623483c0f
4 changed files with 18 additions and 19 deletions

View File

@ -31,9 +31,9 @@ class DataPipelineResponse(BaseResponse):
def list_pipelines(self):
pipelines = self.datapipeline_backend.list_pipelines()
return json.dumps({
"HasMoreResults": False,
"Marker": None,
"PipelineIdList": [
"hasMoreResults": False,
"marker": None,
"pipelineIdList": [
pipeline.to_meta_json() for pipeline in pipelines
]
})
@ -43,7 +43,7 @@ class DataPipelineResponse(BaseResponse):
pipelines = self.datapipeline_backend.describe_pipelines(pipeline_ids)
return json.dumps({
"PipelineDescriptionList": [
"pipelineDescriptionList": [
pipeline.to_json() for pipeline in pipelines
]
})
@ -67,11 +67,10 @@ class DataPipelineResponse(BaseResponse):
object_ids = self.parameters["objectIds"]
pipeline_objects = self.datapipeline_backend.describe_objects(object_ids, pipeline_id)
return json.dumps({
"HasMoreResults": False,
"Marker": None,
"PipelineObjects": [
"hasMoreResults": False,
"marker": None,
"pipelineObjects": [
pipeline_object.to_json() for pipeline_object in pipeline_objects
]
})

View File

@ -1470,5 +1470,5 @@ def test_datapipeline():
dp_conn = boto.datapipeline.connect_to_region('us-east-1')
data_pipelines = dp_conn.list_pipelines()
data_pipelines['PipelineIdList'].should.have.length_of(1)
data_pipelines['PipelineIdList'][0]['name'].should.equal('testDataPipeline')
data_pipelines['pipelineIdList'].should.have.length_of(1)
data_pipelines['pipelineIdList'][0]['name'].should.equal('testDataPipeline')

View File

@ -20,7 +20,7 @@ def test_create_pipeline():
res = conn.create_pipeline("mypipeline", "some-unique-id")
pipeline_id = res["pipelineId"]
pipeline_descriptions = conn.describe_pipelines([pipeline_id])["PipelineDescriptionList"]
pipeline_descriptions = conn.describe_pipelines([pipeline_id])["pipelineDescriptionList"]
pipeline_descriptions.should.have.length_of(1)
pipeline_description = pipeline_descriptions[0]
@ -105,7 +105,7 @@ def test_describing_pipeline_objects():
conn.put_pipeline_definition(PIPELINE_OBJECTS, pipeline_id)
objects = conn.describe_objects(["Schedule", "Default"], pipeline_id)['PipelineObjects']
objects = conn.describe_objects(["Schedule", "Default"], pipeline_id)['pipelineObjects']
objects.should.have.length_of(2)
default_object = [x for x in objects if x['id'] == 'Default'][0]
@ -125,7 +125,7 @@ def test_activate_pipeline():
pipeline_id = res["pipelineId"]
conn.activate_pipeline(pipeline_id)
pipeline_descriptions = conn.describe_pipelines([pipeline_id])["PipelineDescriptionList"]
pipeline_descriptions = conn.describe_pipelines([pipeline_id])["pipelineDescriptionList"]
pipeline_descriptions.should.have.length_of(1)
pipeline_description = pipeline_descriptions[0]
fields = pipeline_description['fields']
@ -141,14 +141,14 @@ def test_listing_pipelines():
response = conn.list_pipelines()
response["HasMoreResults"].should.be(False)
response["Marker"].should.be.none
response["PipelineIdList"].should.have.length_of(2)
response["PipelineIdList"].should.contain({
response["hasMoreResults"].should.be(False)
response["marker"].should.be.none
response["pipelineIdList"].should.have.length_of(2)
response["pipelineIdList"].should.contain({
"id": res1["pipelineId"],
"name": "mypipeline1",
})
response["PipelineIdList"].should.contain({
response["pipelineIdList"].should.contain({
"id": res2["pipelineId"],
"name": "mypipeline2"
})

View File

@ -23,5 +23,5 @@ def test_list_streams():
json_data = json.loads(res.data.decode("utf-8"))
json_data.should.equal({
'PipelineDescriptionList': []
'pipelineDescriptionList': []
})