Bug 35218: (QA follow-up) Perltidy and file permissions

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2023-11-06 19:30:42 +00:00 committed by Tomas Cohen Arazi
parent 6e7059c8a2
commit ea8022b0f2
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 71 additions and 75 deletions

82
t/db_dependent/api/v1/erm_counter_registries.t Normal file → Executable file
View file

@ -40,97 +40,94 @@ subtest 'get() tests' => sub {
my $expected_response = [
{
"abbrev" => "EBSCO",
"address" => "EBSCO Information Services\n10 Estes Street\nIpswich, MA 01938",
"abbrev" => "EBSCO",
"address" => "EBSCO Information Services\n10 Estes Street\nIpswich, MA 01938",
"address_country" => {
"code" => "US",
"name" => "United States of America"
},
"contact" => {
"email" => 'chadmovalli@ebsco.com',
"email" => 'chadmovalli@ebsco.com',
"form_url" => "",
"person" => "Chad Movalli",
"phone" => ""
"person" => "Chad Movalli",
"phone" => ""
},
"content_provider_name" => "EBSCO",
"host_types" => [
{
"name" => "Aggregated_Full_Content"
}
],
"id" => "b2b2736c-2cb9-48ec-91f4-870336acfb1c",
"name" => "EBSCO Information Services",
"reports" => [
"host_types" => [ { "name" => "Aggregated_Full_Content" } ],
"id" => "b2b2736c-2cb9-48ec-91f4-870336acfb1c",
"name" => "EBSCO Information Services",
"reports" => [
{
"counter_release" => "5",
"report_id" => "TR_J4",
"report_name" => "Title Report - Journal Report 4"
"report_id" => "TR_J4",
"report_name" => "Title Report - Journal Report 4"
},
{
"counter_release" => "5",
"report_id" => "DR_D2",
"report_name" => "Database Report - Report 2"
"report_id" => "DR_D2",
"report_name" => "Database Report - Report 2"
},
{
"counter_release" => "5",
"report_id" => "TR_J3",
"report_name" => "Title Report - Journal Report 3"
"report_id" => "TR_J3",
"report_name" => "Title Report - Journal Report 3"
},
{
"counter_release" => "5",
"report_id" => "DR_D1",
"report_name" => "Database Report - Report 1"
"report_id" => "DR_D1",
"report_name" => "Database Report - Report 1"
},
{
"counter_release" => "5",
"report_id" => "TR_J2",
"report_name" => "Title Report - Journal Report 2"
"report_id" => "TR_J2",
"report_name" => "Title Report - Journal Report 2"
},
{
"counter_release" => "5",
"report_id" => "PR",
"report_name" => "Platform Master Report"
"report_id" => "PR",
"report_name" => "Platform Master Report"
},
{
"counter_release" => "5",
"report_id" => "TR_B2",
"report_name" => "Title Report - Book Report 2"
"report_id" => "TR_B2",
"report_name" => "Title Report - Book Report 2"
},
{
"counter_release" => "5",
"report_id" => "TR_B3",
"report_name" => "Title Report - Book Report 3"
"report_id" => "TR_B3",
"report_name" => "Title Report - Book Report 3"
},
{
"counter_release" => "5",
"report_id" => "TR",
"report_name" => "Title Master Report"
"report_id" => "TR",
"report_name" => "Title Master Report"
},
{
"counter_release" => "5",
"report_id" => "TR_B1",
"report_name" => "Title Report - Book Report 1"
"report_id" => "TR_B1",
"report_name" => "Title Report - Book Report 1"
},
{
"counter_release" => "5",
"report_id" => "PR_P1",
"report_name" => "Platform Report - Report 1"
"report_id" => "PR_P1",
"report_name" => "Platform Report - Report 1"
},
{
"counter_release" => "5",
"report_id" => "TR_J1",
"report_name" => "Title Report - Journal Report 1"
"report_id" => "TR_J1",
"report_name" => "Title Report - Journal Report 1"
},
{
"counter_release" => "5",
"report_id" => "DR",
"report_name" => "Database Master Report"
"report_id" => "DR",
"report_name" => "Database Master Report"
}
],
"sushi_services" => [
{
"counter_release" => "5",
"url" => "https:\/\/registry.projectcounter.org\/api\/v1\/sushi-service\/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b\/"
"url" =>
"https:\/\/registry.projectcounter.org\/api\/v1\/sushi-service\/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b\/"
}
],
"website" => "https:\/\/www.ebsco.com\/"
@ -161,7 +158,8 @@ subtest 'get() tests' => sub {
$t->get_ok("//$unauth_userid:$password@/api/v1/erm/counter_registry")->status_is(403);
# Authorised access test
my $q = encode_json( { "name" => "EBSCO Information Services" } );
my $counter_registry = $t->get_ok("//$userid:$password@/api/v1/erm/counter_registry?q=$q")->status_is(200)->tx->res->json;
my $q = encode_json( { "name" => "EBSCO Information Services" } );
my $counter_registry =
$t->get_ok("//$userid:$password@/api/v1/erm/counter_registry?q=$q")->status_is(200)->tx->res->json;
is_deeply( $counter_registry, $expected_response );
};

64
t/db_dependent/api/v1/erm_sushi_services.t Normal file → Executable file
View file

@ -40,33 +40,36 @@ subtest 'get() tests' => sub {
my $service_url = "https://registry.projectcounter.org/api/v1/sushi-service/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b/";
my $expected_response = {
"api_key_info"=> "",
"api_key_required"=> 0,
"contact"=> {
"email"=> 'chadmovalli@ebsco.com',
"form_url"=> "",
"person"=> "Chad Movalli",
"phone"=> ""
"api_key_info" => "",
"api_key_required" => 0,
"contact" => {
"email" => 'chadmovalli@ebsco.com',
"form_url" => "",
"person" => "Chad Movalli",
"phone" => ""
},
"counter_release"=> "5",
"credentials_auto_expire"=> 0,
"credentials_auto_expire_info"=> "",
"customer_id_info"=> "This is your EBSCOhost Customer ID",
"customizations_in_place"=> 0,
"customizations_info"=> "",
"data_host"=> "https:\/\/registry.projectcounter.org\/api\/v1\/usage-data-host\/72a35413-6fcd-44f2-8bce-0c7b2373e33f\/",
"id"=> "b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b",
"ip_address_authorization"=> 0,
"ip_address_authorization_info"=> "",
"notification_count"=> 1,
"notifications_url"=> "https:\/\/registry.projectcounter.org\/api\/v1\/sushi-service\/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b\/notification\/",
"platform_attr_required"=> 0,
"platform_specific_info"=> "",
"request_volume_limits_applied"=> 0,
"request_volume_limits_info"=> "",
"requestor_id_info"=> "Customers generate their Requestor ID in EBSCOAdmin on the SUSHI Authentication tab within the COUNTER R5 Reports section.",
"requestor_id_required"=> 1,
"url"=> "https:\/\/sushi.ebscohost.com\/R5"
"counter_release" => "5",
"credentials_auto_expire" => 0,
"credentials_auto_expire_info" => "",
"customer_id_info" => "This is your EBSCOhost Customer ID",
"customizations_in_place" => 0,
"customizations_info" => "",
"data_host" =>
"https:\/\/registry.projectcounter.org\/api\/v1\/usage-data-host\/72a35413-6fcd-44f2-8bce-0c7b2373e33f\/",
"id" => "b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b",
"ip_address_authorization" => 0,
"ip_address_authorization_info" => "",
"notification_count" => 1,
"notifications_url" =>
"https:\/\/registry.projectcounter.org\/api\/v1\/sushi-service\/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b\/notification\/",
"platform_attr_required" => 0,
"platform_specific_info" => "",
"request_volume_limits_applied" => 0,
"request_volume_limits_info" => "",
"requestor_id_info" =>
"Customers generate their Requestor ID in EBSCOAdmin on the SUSHI Authentication tab within the COUNTER R5 Reports section.",
"requestor_id_required" => 1,
"url" => "https:\/\/sushi.ebscohost.com\/R5"
};
my $librarian = $builder->build_object(
@ -93,12 +96,7 @@ subtest 'get() tests' => sub {
$t->get_ok("//$unauth_userid:$password@/api/v1/erm/sushi_service")->status_is(403);
# Authorised access test
my $q = encode_json(
{
"url" => $service_url
}
);
my $sushi_service = $t->get_ok("//$userid:$password@/api/v1/erm/sushi_service?q=$q")->status_is(200)
->tx->res->json;
my $q = encode_json( { "url" => $service_url } );
my $sushi_service = $t->get_ok("//$userid:$password@/api/v1/erm/sushi_service?q=$q")->status_is(200)->tx->res->json;
is_deeply( $sushi_service, $expected_response );
};