mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
46 lines
1.4 KiB
Ruby
46 lines
1.4 KiB
Ruby
|
Shindo.tests('Aws::SNS | topic lifecycle tests', ['aws', 'sns']) do
|
||
|
|
||
|
tests('success') do
|
||
|
|
||
|
tests("#create_topic('fog_topic_tests')").formats(Aws::SNS::Formats::BASIC.merge('TopicArn' => String)) do
|
||
|
body = Fog::AWS[:sns].create_topic('fog_topic_tests').body
|
||
|
@topic_arn = body["TopicArn"]
|
||
|
body
|
||
|
end
|
||
|
|
||
|
tests("#list_topics").formats(Aws::SNS::Formats::BASIC.merge('Topics' => [String])) do
|
||
|
Fog::AWS[:sns].list_topics.body
|
||
|
end
|
||
|
|
||
|
tests("#set_topic_attributes('#{@topic_arn}', 'DisplayName', 'other-fog_topic_tests')").formats(Aws::SNS::Formats::BASIC) do
|
||
|
Fog::AWS[:sns].set_topic_attributes(@topic_arn, 'DisplayName', 'other-fog_topic_tests').body
|
||
|
end
|
||
|
|
||
|
get_topic_attributes_format = Aws::SNS::Formats::BASIC.merge({
|
||
|
'Attributes' => {
|
||
|
'DisplayName' => String,
|
||
|
'Owner' => String,
|
||
|
'Policy' => String,
|
||
|
'SubscriptionsConfirmed' => Integer,
|
||
|
'SubscriptionsDeleted' => Integer,
|
||
|
'SubscriptionsPending' => Integer,
|
||
|
'TopicArn' => String
|
||
|
}
|
||
|
})
|
||
|
|
||
|
tests("#get_topic_attributes('#{@topic_arn})").formats(get_topic_attributes_format) do
|
||
|
Fog::AWS[:sns].get_topic_attributes(@topic_arn).body
|
||
|
end
|
||
|
|
||
|
tests("#delete_topic('#{@topic_arn}')").formats(Aws::SNS::Formats::BASIC) do
|
||
|
Fog::AWS[:sns].delete_topic(@topic_arn).body
|
||
|
end
|
||
|
|
||
|
end
|
||
|
|
||
|
tests('failure') do
|
||
|
|
||
|
end
|
||
|
|
||
|
end
|