]> sjero.net Git - wget/blob - tests/Test-proxy-auth-basic.px
NEWS: cite --start-pos
[wget] / tests / Test-proxy-auth-basic.px
1 #!/usr/bin/env perl
2
3 use strict;
4 use warnings;
5
6 use HTTPTest;
7
8
9 ###############################################################################
10
11 my $wholefile = "You're all authenticated.\n";
12
13 # code, msg, headers, content
14 my %urls = (
15     'http://no.such.domain/needs-auth.txt' => {
16         auth_method => 'Basic',
17         user => 'fiddle-dee-dee',
18         passwd => 'Dodgson',
19         code => "200",
20         msg => "You want fries with that?",
21         headers => {
22             "Content-type" => "text/plain",
23         },
24         content => $wholefile,
25     },
26 );
27
28 my $cmdline = $WgetTest::WGETPATH . " --user=fiddle-dee-dee --password=Dodgson"
29     . " -e http_proxy=localhost:{{port}} http://no.such.domain/needs-auth.txt";
30
31 my $expected_error_code = 0;
32
33 my %expected_downloaded_files = (
34     'needs-auth.txt' => {
35         content => $wholefile,
36     },
37 );
38
39 ###############################################################################
40
41 my $the_test = HTTPTest->new (name => "Test-auth-basic",
42                               input => \%urls,
43                               cmdline => $cmdline,
44                               errcode => $expected_error_code,
45                               output => \%expected_downloaded_files);
46 exit $the_test->run();
47
48 # vim: et ts=4 sw=4
49