forked from omega/amazon-simpledb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use lib 'lib'; | ||
|
||
use Test::More; | ||
|
||
plan tests => 8; | ||
|
||
use_ok('Amazon::SimpleDB::Domain'); | ||
use_ok('Amazon::SimpleDB::ErrorResponse'); | ||
use_ok('Amazon::SimpleDB::GetAttributesResponse'); | ||
use_ok('Amazon::SimpleDB::Item'); | ||
use_ok('Amazon::SimpleDB::ListDomainsResponse'); | ||
use_ok('Amazon::SimpleDB::QueryResponse'); | ||
use_ok('Amazon::SimpleDB::Response'); | ||
use_ok('Amazon::SimpleDB'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/perl -w | ||
use warnings; | ||
use strict; | ||
|
||
use lib 'lib'; | ||
|
||
use Test::More; | ||
|
||
unless ($ENV{'AMAZON_S3_EXPENSIVE_TESTS'}) { | ||
plan skip_all => 'Testing this module for real costs money.'; | ||
} else { | ||
plan tests => 8; | ||
} | ||
|
||
my $aws_access_key_id = $ENV{'AWS_ACCESS_KEY_ID'}; | ||
my $aws_secret_access_key = $ENV{'AWS_ACCESS_KEY_SECRET'}; | ||
|
||
use Amazon::SimpleDB; | ||
|
||
my $sdb = | ||
Amazon::SimpleDB->new( | ||
{ | ||
aws_access_key_id => $aws_access_key_id, | ||
aws_secret_access_key => $aws_secret_access_key | ||
} | ||
); | ||
|
||
ok($sdb); | ||
ok($sdb->isa('Amazon::SimpleDB')); | ||
|
||
my $domainname = 'amazon-simpledb-test-' . lc $aws_access_key_id; | ||
|
||
ok($sdb->create_domain($domainname)); | ||
|
||
my $r_domains = $sdb->domains; | ||
ok($r_domains->is_success); | ||
|
||
my ($test1) = grep { $_->name eq $domainname } $r_domains->results; | ||
ok($test1); | ||
|
||
my $r_delete_domain = $sdb->delete_domain($domainname); | ||
ok($r_delete_domain->is_success); | ||
|
||
my $r_domains2 = $sdb->domains; | ||
ok($r_domains2->is_success); | ||
|
||
my ($test2) = grep { $_->name eq $domainname } $r_domains2->results; | ||
ok(!$test2); # gone? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!perl -T | ||
|
||
use Test::More; | ||
eval "use Test::Pod 1.14"; | ||
plan skip_all => "Test::Pod 1.14 required for testing POD: $@" if $@; | ||
all_pod_files_ok(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use Test::More; | ||
eval "use Test::Pod::Coverage 1.00"; | ||
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@; | ||
all_pod_coverage_ok( ); | ||
|
||
# Workaround for dumb bug (fixed in 5.8.7) where Test::Builder thinks that | ||
# certain "die"s that happen inside evals are not actually inside evals, | ||
# because caller() is broken if you turn on $^P like Module::Refresh does | ||
# | ||
# (I mean, if we've gotten to this line, then clearly the test didn't die, no?) | ||
Test::Builder->new->{Test_Died} = 0; | ||
|