~ubuntu-branches/ubuntu/trusty/wget/trusty-updates

« back to all changes in this revision

Viewing changes to tests/Test-auth-no-challenge-url.px

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2009-12-12 08:15:59 UTC
  • mfrom: (2.1.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091212081559-mvccl4kzdqb138y3
Tags: 1.12-1.1ubuntu1
* Merge from debian testing, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
* Keep build dependencies in main:
  - debian/control: remove info2man build-dep
  - debian/patches/00list: disable wget-infopod_generated_manpage.dpatch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/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
    '/needs-auth.txt' => {
 
16
        auth_no_challenge => 1,
 
17
        auth_method => 'Basic',
 
18
        user => 'fiddle-dee-dee',
 
19
        passwd => 'Dodgson',
 
20
        code => "200",
 
21
        msg => "You want fries with that?",
 
22
        headers => {
 
23
            "Content-type" => "text/plain",
 
24
        },
 
25
        content => $wholefile,
 
26
    },
 
27
);
 
28
 
 
29
my $cmdline = $WgetTest::WGETPATH . " --auth-no-challenge "
 
30
    . "http://fiddle-dee-dee:Dodgson\@localhost:{{port}}/needs-auth.txt";
 
31
 
 
32
my $expected_error_code = 0;
 
33
 
 
34
my %expected_downloaded_files = (
 
35
    'needs-auth.txt' => {
 
36
        content => $wholefile,
 
37
    },
 
38
);
 
39
 
 
40
###############################################################################
 
41
 
 
42
my $the_test = HTTPTest->new (name => "Test-auth-no-challenge-url",
 
43
                              input => \%urls,
 
44
                              cmdline => $cmdline,
 
45
                              errcode => $expected_error_code,
 
46
                              output => \%expected_downloaded_files);
 
47
exit $the_test->run();
 
48
 
 
49
# vim: et ts=4 sw=4
 
50