From: Andy Grundman Date: Fri, 5 Dec 2008 17:25:29 +0000 (+0000) Subject: Fix upload test to work with remote servers, don't check for deleted files X-Git-Tag: 5.8000_05~117 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=ad51fa70a7d26981b1da0dabdc1e193ade38f3d7 Fix upload test to work with remote servers, don't check for deleted files --- diff --git a/t/aggregate/live_engine_request_uploads.t b/t/aggregate/live_engine_request_uploads.t index cd57b03..47913db 100644 --- a/t/aggregate/live_engine_request_uploads.t +++ b/t/aggregate/live_engine_request_uploads.t @@ -11,6 +11,7 @@ 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' ); + } } } @@ -128,7 +135,13 @@ use Path::Class::Dir; 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' ); + 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 +210,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 +276,14 @@ 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' ); + + 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 +319,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/";