"Fossies" - the Fresh Open Source Software Archive

Member "libwww-perl-6.43/xt/author/net/proxy.t" (26 Nov 2019, 606 Bytes) of package /linux/www/libwww-perl-6.43.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

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