1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
use strict;
use warnings;
use Test::More;
use FindBin qw( $Bin );
use HTTP::Request ();
use LWP::UserAgent ();
if (!-e "$Bin/config.pl") {
plan skip_all => 'no net config file';
exit 0;
}
require "$Bin/config.pl";
plan tests => 3;
ok(defined $net::ftp_proxy, 'net::ftp_proxy exists');
my $ua = LWP::UserAgent->new;
$ua->proxy('ftp', $net::ftp_proxy);
my $url = 'ftp://ftp.uninett.no/';
my $request = HTTP::Request->new('GET', $url);
my $response = $ua->request($request, undef, undef);
isa_ok($response, 'HTTP::Response', 'got a proper response object');
ok($response->is_success, 'is_success');
|