~ubuntu-branches/ubuntu/maverick/wget/maverick

« back to all changes in this revision

Viewing changes to tests/Test-noop.px

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-05-27 11:49:54 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080527114954-ame070pjhqtofeaf
Tags: 1.11.2-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.

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 $index = <<EOF;
 
11
<html>
 
12
<head>
 
13
  <title>Page Title</title>
 
14
</head>
 
15
<body>
 
16
  <h1>Page Title</h1>
 
17
  <p>
 
18
    Some text here.
 
19
  </p>
 
20
</body>
 
21
</html>
 
22
EOF
 
23
 
 
24
# code, msg, headers, content
 
25
my %urls = (
 
26
    '/index.html' => {
 
27
        code => "200",
 
28
        msg => "Dontcare",
 
29
        headers => {
 
30
            "Content-type" => "text/html",
 
31
        },
 
32
        content => $index
 
33
    },
 
34
);
 
35
 
 
36
my $cmdline = $WgetTest::WGETPATH . " http://localhost:8080/";
 
37
 
 
38
my $expected_error_code = 0;
 
39
 
 
40
my %expected_downloaded_files = (
 
41
    'index.html' => {
 
42
        content => $index,
 
43
    }
 
44
);
 
45
 
 
46
###############################################################################
 
47
 
 
48
my $the_test = HTTPTest->new (name => "Test-noop",
 
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