File: 03merge.t

package info (click to toggle)
libapache-authenhook-perl 2.00-04%2Bpristine-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 236 kB
  • sloc: perl: 182; makefile: 13; sh: 11
file content (49 lines) | stat: -rwxr-xr-x 1,268 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use strict;
use warnings FATAL => 'all';

use Apache::Test;
use Apache::TestRequest;
use Apache::TestUtil;

# test DIR_MERGE logic

plan tests => 6, (need_lwp &&
                  need_module('mod_auth_digest') &&
                  need_module('mod_auth_basic'));

my $url = '/digest/merge/index.html';
my $response = GET $url;
ok t_cmp($response->code,
         401,
         "GET $url");

# authenticated
$response = GET $url, username => 'testuser', password => 'testpass';
ok t_cmp($response->code,
         200,
         "GET $url, username => 'testuser', password => 'testpass'");

# bad pass
$response = GET $url, username => 'testuser', password => 'foo';
ok t_cmp($response->code,
         401,
         "GET $url, username => 'testuser', password => 'foo'");

$url = '/basic/merge/index.html';

$response = GET $url;
ok t_cmp($response->code,
         401,
         "GET $url");

# authenticated
$response = GET $url, username => 'testuser', password => 'testpass';
ok t_cmp($response->code,
         200,
         "GET $url, username => 'testuser', password => 'testpass'");

# bad pass
$response = GET $url, username => 'testuser', password => 'foo';
ok t_cmp($response->code,
         401,
         "GET $url, username => 'testuser', password => 'foo'");