AWS-CLIWrapper
view release on metacpan or search on metacpan
t/bin/mock-aws view on Meta::CPAN
sub help {
die <<__END__;
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: the following arguments are required: operation
__END__
}
sub ecs_list_clusters {
print <<__END__;
{
"clusterArns": [
"arn:aws:ecs:us-foo-1:123456789:cluster/foo",
"arn:aws:ecs:us-foo-1:123456789:cluster/bar",
xt/03_pod.t view on Meta::CPAN
use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
all_pod_files_ok();
xt/19_error.t view on Meta::CPAN
like($err->{Message}, qr/(Unknown options:|Something is wrong)/, 'err Message');
### invalid option value
$res = $aws->ec2('describe-instances', { instance_ids => ['blah'] });
$err = $AWS::CLIWrapper::Error;
ok(!$res, 'invalid option value');
like($err->{Code}, qr/(Unknown|InvalidInstanceID.Malformed)/, 'err Code');
like($err->{Message}, qr/(Invalid id:|Unknown)/, 'err Message');
### required option
$res = $aws->ec2('run-instances');
$err = $AWS::CLIWrapper::Error;
ok(!$res, 'required option');
is($err->{Code}, 'Unknown', 'err Code');
like($err->{Message}, qr/(?:is required|MissingParameter)/, 'err Message');
###
done_testing;
xt/30_compat.t view on Meta::CPAN
ok(!$res); # should fail
unlike($AWS::CLIWrapper::Error->{Message}, qr/Unknown options:/);
# < 0.14.0 : fail case
$res = $aws->ec2('run-instances', {
image_id => '1',
count => 1,
});
ok(!$res); # should fail
unlike($AWS::CLIWrapper::Error->{Message}, qr/--(?:min|max)-count is required/);
};
# >= 0.15.0 : s3 and s3api (formerly s3)
# < 0.15.0 : s3 only
subtest 's3 and s3api' => sub {
plan skip_all => "Suport S3 >= 0.8.0"
if $aws->awscli_version < 0.8.0;
# >= 0.15.0
$res = $aws->s3api('list-buckets');
ok($res, 's3api list-buckets');
xt/90_dependencies.t view on Meta::CPAN
# -*- mode: cperl; -*-
use Test::More;
eval "use App::scan_prereqs_cpanfile";
plan skip_all => "App::scan_prereqs_cpanfile required for testing module dependencies"
if $@;
my $diff = `scan-prereqs-cpanfile --ignore junk --diff cpanfile`;
is($diff, "", "diff cpanfile");
done_testing;
( run in 0.458 second using v1.01-cache-2.11-cpan-0a6323c29d9 )