File: 2_options.t

package info (click to toggle)
libhttp-dav-perl 0.31-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 384 kB
  • ctags: 251
  • sloc: perl: 3,453; xml: 90; makefile: 41; sh: 20
file content (33 lines) | stat: -rw-r--r-- 849 bytes parent folder | download | duplicates (10)
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
#!/usr/local/bin/perl -w
use strict;
use HTTP::DAV;
use Test;
use lib 't';
use TestDetails qw($test_user $test_pass $test_url do_test fail_tests test_callback);

my $TESTS;
$TESTS = 6;
plan tests => $TESTS; 
fail_tests($TESTS) unless $test_url =~ /http/;

my $dav = HTTP::DAV->new;
$dav->DebugLevel(3);

$dav->credentials( $test_user, $test_pass, $test_url );

my $resource = $dav->new_resource( -uri => $test_url );
my $response = $resource->options();
if ( ! ok($response->is_success) ) {
   print $response->message() ."\n";
}

print "DAV compliancy: ". $resource->is_dav_compliant(). "\n";
ok($resource->is_dav_compliant());

my $options = $resource->get_options || "";
print "$options\n";
ok($options,'/PROPFIND/');
ok($resource->is_option('PROPFIND'),1);
ok($resource->is_option('JUNKOPTION'),0);
   
ok($resource->get_username(),$test_user);