X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Flive_engine_request_uploads.t;h=df98f08a7023a24aae4816130c7e4b81401d92b4;hb=30305469e1d8f922119d64d631ccd800358a7698;hp=cd57b035684e72c2470b2b6808d5d85e99005287;hpb=ed4ac83874e7be7d27f20e3ef7b1907dabe97bd7;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/live_engine_request_uploads.t b/t/aggregate/live_engine_request_uploads.t index cd57b03..df98f08 100644 --- a/t/aggregate/live_engine_request_uploads.t +++ b/t/aggregate/live_engine_request_uploads.t @@ -6,11 +6,12 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../lib"; -use Test::More tests => 101; +use Test::More tests => 105; use Catalyst::Test 'TestApp'; use Catalyst::Request; use Catalyst::Request::Upload; +use HTTP::Body::OctetStream; use HTTP::Headers; use HTTP::Headers::Util 'split_header_words'; use HTTP::Request::Common; @@ -72,7 +73,13 @@ use Path::Class::Dir; is( $creq->parameters->{ $upload->filename }, $upload->filename, 'legacy param method ok' ); - ok( !-e $upload->tempname, 'Upload temp file was deleted' ); + SKIP: + { + if ( $ENV{CATALYST_SERVER} ) { + skip 'Not testing for deleted file on remote server', 1; + } + ok( !-e $upload->tempname, 'Upload temp file was deleted' ); + } } } @@ -127,8 +134,15 @@ use Path::Class::Dir; is( $upload->type, $part->content_type, 'Upload Content-Type' ); is( $upload->filename, $parameters{filename}, 'Upload filename' ); is( $upload->size, length( $part->content ), 'Upload Content-Length' ); - - ok( !-e $upload->tempname, 'Upload temp file was deleted' ); + is( $upload->basename, $parameters{filename}, 'Upload basename' ); + + SKIP: + { + if ( $ENV{CATALYST_SERVER} ) { + skip 'Not testing for deleted file on remote server', 1; + } + ok( !-e $upload->tempname, 'Upload temp file was deleted' ); + } } } @@ -197,7 +211,13 @@ use Path::Class::Dir; for my $file ( $creq->upload ) { my $upload = $creq->upload($file); - ok( !-e $upload->tempname, 'Upload temp file was deleted' ); + SKIP: + { + if ( $ENV{CATALYST_SERVER} ) { + skip 'Not testing for deleted file on remote server', 1; + } + ok( !-e $upload->tempname, 'Upload temp file was deleted' ); + } } } @@ -257,7 +277,15 @@ use Path::Class::Dir; is( $upload->type, $part->content_type, 'Upload Content-Type' ); is( $upload->size, length( $part->content ), 'Upload Content-Length' ); is( $upload->filename, 'catalyst_130pix.gif', 'Upload Filename' ); - ok( !-e $upload->tempname, 'Upload temp file was deleted' ); + is( $upload->basename, 'catalyst_130pix.gif', 'Upload basename' ); + + SKIP: + { + if ( $ENV{CATALYST_SERVER} ) { + skip 'Not testing for deleted file on remote server', 1; + } + ok( !-e $upload->tempname, 'Upload temp file was deleted' ); + } } } @@ -293,12 +321,22 @@ use Path::Class::Dir; isa_ok( $body, 'HTTP::Body::OctetStream' ); isa_ok($body->body, 'File::Temp'); - ok( !-e $body->body->filename, 'Upload temp file was deleted' ); + SKIP: + { + if ( $ENV{CATALYST_SERVER} ) { + skip 'Not testing for deleted file on remote server', 1; + } + ok( !-e $body->body->filename, 'Upload temp file was deleted' ); + } } # test uploadtmp config var - +SKIP: { + if ( $ENV{CATALYST_SERVER} ) { + skip 'Not testing uploadtmp on remote server', 14; + } + my $creq; my $dir = "$FindBin::Bin/";