File: 10-nonexistent-host.t

package info (click to toggle)
libwww-mechanize-shell-perl 0.48-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 496 kB
  • ctags: 269
  • sloc: perl: 2,925; makefile: 5
file content (22 lines) | stat: -rwxr-xr-x 500 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl -w
use strict;

use Test::More tests => 2;
SKIP: {
# Disable all ReadLine functionality
$ENV{PERL_RL} = 0;
delete @ENV{qw(HTTP_PROXY http_proxy CGI_HTTP_PROXY)};

use_ok('WWW::Mechanize::Shell');

my $s = WWW::Mechanize::Shell->new( 'test', rcfile => undef, warnings => undef );

my $called;
{ no warnings 'redefine','once';
  *WWW::Mechanize::Shell::status = sub {};
};

$s->cmd('get http://999.999.999.999');
is($s->agent->res->code, 500, "LWP returns 500 for host not found");

};