Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
josegomezr committed Nov 16, 2023
1 parent b954c63 commit 65c22e1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions t/ui/27-plugin_obs_rsync_obs_status.t
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,20 @@ my $server_process = sub {
my $mock = Mojolicious->new;
$mock->mode('test');

my $www_authenticate = qq(Signature realm="Use your developer account",headers="(created)"); # uncoverable statement
my $www_authenticate = qq(Signature realm="Use your developer account",headers="(created)");
$mock->routes->get(
'/build/ProjWithAuth/_result' => sub ($c) {
return $c->render(status => 200, text => $fake_response_by_project{Proj1}) if $c->req->headers->authorization;
return $c->render(status => 200, text => $fake_response_by_project{Proj1})
if $c->req->headers->authorization;
$c->res->headers->www_authenticate($www_authenticate);
return $c->render(status => 401, text => 'login');
});

$mock->routes->get(
'/build/ProjTestingSignature/_result' => sub ($c) {
my $client_auth_header = $c->req->headers->authorization // '';
return $c->render(status => 200, text => $fake_response_by_project{Proj1}) if $auth_header_exact eq $client_auth_header;
return $c->render(status => 200, text => $fake_response_by_project{Proj1})
if $auth_header_exact eq $client_auth_header;
$c->res->headers->www_authenticate($www_authenticate);
return $c->render(status => 401, text => 'login');
});
Expand All @@ -118,7 +120,7 @@ my $server_process = sub {
"/build/$project/_result" => sub ($c) {
my $pkg = $c->param('package');
return $c->render(status => 404) if !$pkg and $project ne 'Proj1';
return $c->render(status => 200, text => $fake_response_by_project{$project}); # uncoverable statement
return $c->render(status => 200, text => $fake_response_by_project{$project});
});
}
my $daemon = Mojo::Server::Daemon->new(app => $mock, listen => [$host]);
Expand Down

0 comments on commit 65c22e1

Please sign in to comment.