Improve unit test (#1901)

environments/ppa-mbqj77/deployments/799^2
Christophe Maudoux 6 years ago
parent 05271f9b76
commit 5ef6443103
  1. 9
      lemonldap-ng-handler/t/65-Lemonldap-NG-Handler-PSGI-ServiceToken.t

@ -26,6 +26,8 @@ init(
exportedHeaders => {
'test2.example.com' => {
'Auth-User' => '$uid',
'empty' => undef,
'zero' => "'0'",
},
}
}
@ -114,6 +116,13 @@ ok(
ok( $res->[0] == 200, 'Code is 200' ) or explain( $res->[0], 200 );
count(2);
my %headers = @{ $res->[1] };
ok( $headers{'zero'} eq '0', 'Found "zero" header with "0"' )
or print STDERR Data::Dumper::Dumper( $res->[1] );
ok( $headers{'empty'} eq '', 'Found "empty" header without value' )
or print STDERR Data::Dumper::Dumper( $res->[1] );
count(2);
@headers = grep { /service|^XFromVH$/ } @{ $res->[1] };
@values = grep { /\.example\.com|^$sessionId$/ } @{ $res->[1] };
ok( @headers == 2, 'Found 2 service headers' )

Loading…
Cancel
Save