2011-07-19 16:10:26 -04:00
|
|
|
Shindo.tests('AWS::SQS | queue requests', ['aws']) do
|
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
|
|
|
create_queue_format = AWS::SQS::Formats::BASIC.merge({
|
|
|
|
'QueueUrl' => String
|
|
|
|
})
|
|
|
|
|
|
|
|
tests("#create_queue('fog_queue_tests')").formats(create_queue_format) do
|
|
|
|
pending if Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
data = Fog::AWS[:sqs].create_queue('fog_queue_tests').body
|
2011-07-19 16:10:26 -04:00
|
|
|
@queue_url = data['QueueUrl']
|
|
|
|
data
|
|
|
|
end
|
|
|
|
|
|
|
|
list_queues_format = AWS::SQS::Formats::BASIC.merge({
|
|
|
|
'QueueUrls' => [String]
|
|
|
|
})
|
|
|
|
|
|
|
|
tests("#list_queues").formats(list_queues_format) do
|
|
|
|
pending if Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:sqs].list_queues.body
|
2011-07-19 16:10:26 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#set_queue_attributes('#{@queue_url}', 'VisibilityTimeout', 60)").formats(AWS::SQS::Formats::BASIC) do
|
|
|
|
pending if Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:sqs].set_queue_attributes(@queue_url, 'VisibilityTimeout', 60).body
|
2011-07-19 16:10:26 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
get_queue_attributes_format = AWS::SQS::Formats::BASIC.merge({
|
|
|
|
'Attributes' => {
|
|
|
|
'ApproximateNumberOfMessages' => Integer,
|
|
|
|
'ApproximateNumberOfMessagesNotVisible' => Integer,
|
|
|
|
'CreatedTimestamp' => Time,
|
|
|
|
'MaximumMessageSize' => Integer,
|
|
|
|
'LastModifiedTimestamp' => Time,
|
|
|
|
'MessageRetentionPeriod' => Integer,
|
|
|
|
'QueueArn' => String,
|
|
|
|
'VisibilityTimeout' => Integer
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2011-07-19 18:53:26 -04:00
|
|
|
tests("#get_queue_attributes('#{@queue_url}', 'All')").formats(get_queue_attributes_format) do
|
2011-07-19 16:10:26 -04:00
|
|
|
pending if Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:sqs].get_queue_attributes(@queue_url, 'All').body
|
2011-07-19 16:10:26 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#delete_queue('#{@queue_url}')").formats(AWS::SQS::Formats::BASIC) do
|
|
|
|
pending if Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:sqs].delete_queue(@queue_url).body
|
2011-07-19 16:10:26 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|