]> sjero.net Git - wget/blob - tests/Test--no-content-disposition.px
Automated merge with file:/home/micah/devel/wget/eleven
[wget] / tests / Test--no-content-disposition.px
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 use HTTPTest;
6
7
8 ###############################################################################
9
10 my $dummyfile = <<EOF;
11 <html>
12 <head>
13   <title>Page Title</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     '/dummy.html' => {
26         code => "200",
27         msg => "Dontcare",
28         headers => {
29             "Content-type" => "text/html",
30             "Content-Disposition" => "attachment; filename=\"filename.html\"",
31         },
32         content => $dummyfile,
33     },
34 );
35
36 my $cmdline = $WgetTest::WGETPATH . " --no-content-disposition http://localhost:8080/dummy.html";
37
38 my $expected_error_code = 0;
39
40 my %expected_downloaded_files = (
41     'dummy.html' => {
42         content => $dummyfile,
43     }
44 );
45
46 ###############################################################################
47
48 my $the_test = HTTPTest->new (name => "Test--no-content-disposition",
49                               input => \%urls, 
50                               cmdline => $cmdline, 
51                               errcode => $expected_error_code, 
52                               output => \%expected_downloaded_files);
53 exit $the_test->run();
54
55 # vim: et ts=4 sw=4
56