2010-11-17 13:29:58 -05:00
|
|
|
Shindo.tests('AWS::IAM | user requests', ['aws']) do
|
|
|
|
|
2010-11-17 17:29:33 -05:00
|
|
|
unless Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:iam].create_group('fog_user_tests')
|
2010-11-17 17:29:33 -05:00
|
|
|
end
|
2010-11-17 13:29:58 -05:00
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
|
|
|
@user_format = {
|
|
|
|
'User' => {
|
|
|
|
'Arn' => String,
|
|
|
|
'Path' => String,
|
|
|
|
'UserId' => String,
|
|
|
|
'UserName' => String
|
|
|
|
},
|
|
|
|
'RequestId' => String
|
|
|
|
}
|
|
|
|
|
|
|
|
tests("#create_user('fog_user')").formats(@user_format) do
|
2010-11-17 17:29:33 -05:00
|
|
|
pending if Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:iam].create_user('fog_user').body
|
2010-11-17 13:29:58 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
@users_format = {
|
|
|
|
'Users' => [{
|
|
|
|
'Arn' => String,
|
|
|
|
'Path' => String,
|
|
|
|
'UserId' => String,
|
|
|
|
'UserName' => String
|
|
|
|
}],
|
|
|
|
'IsTruncated' => Fog::Boolean,
|
|
|
|
'RequestId' => String
|
|
|
|
}
|
|
|
|
|
|
|
|
tests("#list_users").formats(@users_format) do
|
2010-11-17 17:29:33 -05:00
|
|
|
pending if Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:iam].list_users.body
|
2010-11-17 13:29:58 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#add_user_to_group('fog_user_tests', 'fog_user')").formats(AWS::IAM::Formats::BASIC) do
|
2010-11-17 17:29:33 -05:00
|
|
|
pending if Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:iam].add_user_to_group('fog_user_tests', 'fog_user').body
|
2010-11-17 13:29:58 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#remove_user_from_group('fog_user_tests', 'fog_user')").formats(AWS::IAM::Formats::BASIC) do
|
2010-11-17 17:29:33 -05:00
|
|
|
pending if Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:iam].remove_user_from_group('fog_user_tests', 'fog_user').body
|
2010-11-17 13:29:58 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#delete_user('fog_user')").formats(AWS::IAM::Formats::BASIC) do
|
2010-11-17 17:29:33 -05:00
|
|
|
pending if Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:iam].delete_user('fog_user').body
|
2010-11-17 13:29:58 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
test('failing conditions')
|
|
|
|
end
|
|
|
|
|
2010-11-17 17:29:33 -05:00
|
|
|
unless Fog.mocking?
|
2011-09-15 09:01:03 -04:00
|
|
|
Fog::AWS[:iam].delete_group('fog_user_tests')
|
2010-11-17 17:29:33 -05:00
|
|
|
end
|
2010-11-17 13:29:58 -05:00
|
|
|
|
|
|
|
end
|