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

« back to all changes in this revision

Viewing changes to tests/Test--spider-HTTP-Content-Disposition.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 -w
2
 
 
3
 
use strict;
4
 
 
5
 
use HTTPTest;
6
 
 
7
 
 
8
 
###############################################################################
9
 
 
10
 
my $mainpage = <<EOF;
11
 
<html>
12
 
<head>
13
 
  <title>Main Page</title>
14
 
</head>
15
 
<body>
16
 
  <p>
17
 
    Some text.
18
 
  </p>
19
 
</body>
20
 
</html>
21
 
EOF
22
 
 
23
 
# code, msg, headers, content
24
 
my %urls = (
25
 
    '/index.html' => {
26
 
        code => "200",
27
 
        msg => "Dontcare",
28
 
        headers => {
29
 
            "Content-type" => "text/html",
30
 
            "Content-Disposition" => "attachment; filename=\"filename.html\"",
31
 
        },
32
 
        content => $mainpage,
33
 
    },
34
 
);
35
 
 
36
 
my $cmdline = $WgetTest::WGETPATH . " --spider http://localhost:8080/index.html";
37
 
 
38
 
my $expected_error_code = 256;
39
 
 
40
 
my %expected_downloaded_files = (
41
 
);
42
 
 
43
 
###############################################################################
44
 
 
45
 
my $the_test = HTTPTest->new (name => "Test--spider-HTTP-Content-Disposition",
46
 
                              input => \%urls, 
47
 
                              cmdline => $cmdline, 
48
 
                              errcode => $expected_error_code, 
49
 
                              output => \%expected_downloaded_files);
50
 
exit $the_test->run();
51
 
 
52
 
# vim: et ts=4 sw=4
53