Changeset 34099

Show
Ignore:
Timestamp:
06/22/09 13:22:54 (6 years ago)
Author:
nyarla
Message:

net_amazonプラグインのテストをAmazonのAPIの変更に追従させた

Location:
lang/perl/minish/trunk/t/10_plugins/net_amazon
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/minish/trunk/t/10_plugins/net_amazon/20_request.t

    r33876 r34099  
    1414 
    1515my $apikey = q{}; 
    16 my $envkey = q{MINISH_PLUGIN_NET_AMAZON_APIKEY}; 
    17 if ( exists $ENV{$envkey} ) { 
    18     $apikey = $ENV{$envkey}; 
     16my $secret = q{}; 
     17my $prefix = q{MINISH_PLUGIN_NET_AMAZON}; 
     18if ( exists $ENV{"${prefix}_APIKEY"} && exists $ENV{"${prefix}_SECRET"} ) { 
     19    $apikey = $ENV{"${prefix}_APIKEY"}; 
     20    $secret = $ENV{"${prefix}_SECRET"}; 
    1921} 
    2022else { 
    21     plan skip_all => "${envkey} is not specified."; 
     23    plan skip_all => "${prefix}_APIKEY or ${prefix}_SECRET is not specified"; 
    2224} 
    2325 
     
    3436my $plugin = $class->new( config => { 
    3537    amazon => { 
    36         token   => $apikey, 
    37         locale  => 'jp', 
     38        token       => $apikey, 
     39        secret_key  => $secret, 
     40        locale      => 'jp', 
    3841    }, 
    3942} ); 
  • lang/perl/minish/trunk/t/10_plugins/net_amazon/30_prepare.t

    r33876 r34099  
    1414 
    1515my $apikey = q{}; 
    16 my $envkey = q{MINISH_PLUGIN_NET_AMAZON_APIKEY}; 
    17 if ( exists $ENV{$envkey} ) { 
    18     $apikey = $ENV{$envkey}; 
     16my $secret = q{}; 
     17my $prefix = q{MINISH_PLUGIN_NET_AMAZON}; 
     18if ( exists $ENV{"${prefix}_APIKEY"} && exists $ENV{"${prefix}_SECRET"} ) { 
     19    $apikey = $ENV{"${prefix}_APIKEY"}; 
     20    $secret = $ENV{"${prefix}_SECRET"}; 
    1921} 
    2022else { 
    21     plan skip_all => "${envkey} is not specified."; 
     23    plan skip_all => "${prefix}_APIKEY or ${prefix}_SECRET is not specified"; 
    2224} 
     25 
    2326 
    2427plan tests => 6; 
     
    4144my $plugin = $class->new( config => { 
    4245    amazon => { 
    43         token   => $apikey, 
    44         locale  => 'jp', 
     46        token       => $apikey, 
     47        secret_key  => $secret, 
     48        locale      => 'jp', 
    4549    }, 
    4650} ); 
  • lang/perl/minish/trunk/t/10_plugins/net_amazon/40_page.t

    r33876 r34099  
    1414 
    1515my $apikey = q{}; 
    16 my $envkey = q{MINISH_PLUGIN_NET_AMAZON_APIKEY}; 
    17 if ( exists $ENV{$envkey} ) { 
    18     $apikey = $ENV{$envkey}; 
     16my $secret = q{}; 
     17my $prefix = q{MINISH_PLUGIN_NET_AMAZON}; 
     18if ( exists $ENV{"${prefix}_APIKEY"} && exists $ENV{"${prefix}_SECRET"} ) { 
     19    $apikey = $ENV{"${prefix}_APIKEY"}; 
     20    $secret = $ENV{"${prefix}_SECRET"}; 
    1921} 
    2022else { 
    21     plan skip_all => "${envkey} is not specified."; 
     23    plan skip_all => "${prefix}_APIKEY or ${prefix}_SECRET is not specified"; 
    2224} 
     25 
    2326 
    2427plan tests => 3; 
     
    4548my $plugin = $class->new( config => { 
    4649    amazon => { 
    47         token   => $apikey, 
    48         locale  => 'jp', 
     50        token       => $apikey, 
     51        secret_key  => $secret, 
     52        locale      => 'jp', 
    4953    }, 
    5054} );