Bugzilla – Attachment 179657 Details for
Bug 39190
Rework new (S)FTP classes to be polymorphic classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39190: Remove test routine from API
Bug-39190-Remove-test-routine-from-API.patch (text/plain), 3.00 KB, created by
Martin Renvoize (ashimema)
on 2025-03-24 15:58:22 UTC
(
hide
)
Description:
Bug 39190: Remove test routine from API
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-03-24 15:58:22 UTC
Size:
3.00 KB
patch
obsolete
>From 37eee37619ae3d1b62b2f82eb5849a673853efa7 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 14 Feb 2025 16:24:04 +0000 >Subject: [PATCH] Bug 39190: Remove test routine from API > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/REST/V1/Config/SFTP/Servers.pm | 15 -------- > t/db_dependent/api/v1/sftp_servers.t | 52 ++-------------------------- > 2 files changed, 2 insertions(+), 65 deletions(-) > >diff --git a/Koha/REST/V1/Config/SFTP/Servers.pm b/Koha/REST/V1/Config/SFTP/Servers.pm >index 8a53d2431db..7578d3cd934 100644 >--- a/Koha/REST/V1/Config/SFTP/Servers.pm >+++ b/Koha/REST/V1/Config/SFTP/Servers.pm >@@ -166,19 +166,4 @@ sub delete { > }; > } > >-=head3 test >- >-Controller method that invokes Koha::SFTP::Server->test_conn >- >-=cut >- >-sub test { >- my $c = shift->openapi->valid_input or return; >- >- my $sftp_server = Koha::File::Transports->find( $c->param('sftp_server_id') ); >- >- return $c->render_resource_not_found("FTP/SFTP server") >- unless $sftp_server; >-} >- > 1; >diff --git a/t/db_dependent/api/v1/sftp_servers.t b/t/db_dependent/api/v1/sftp_servers.t >index 80e6faea0f3..6e12e06b7ca 100755 >--- a/t/db_dependent/api/v1/sftp_servers.t >+++ b/t/db_dependent/api/v1/sftp_servers.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 6; >+use Test::More tests => 5; > use Test::Mojo; > > use t::lib::TestBuilder; >@@ -400,52 +400,4 @@ subtest 'delete() tests' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'test() tests' => sub { >- >- plan tests => 5; >- >- $schema->storage->txn_begin; >- >- my $librarian = $builder->build_object( >- { >- class => 'Koha::Patrons', >- value => { flags => 3**2 } # parameters flag = 3 >- } >- ); >- my $password = 'thePassword123'; >- $librarian->set_password( { password => $password, skip_validation => 1 } ); >- my $userid = $librarian->userid; >- >- my $patron = $builder->build_object( >- { >- class => 'Koha::Patrons', >- value => { flags => 0 } >- } >- ); >- >- $patron->set_password( { password => $password, skip_validation => 1 } ); >- my $unauth_userid = $patron->userid; >- >- my $sftp_server = $builder->build_object( >- { >- class => 'Koha::File::Transports', >- value => { >- password => undef, >- key_file => undef, >- status => undef, >- }, >- } >- ); >- my $sftp_server_id = $sftp_server->id; >- >- # Unauthorized attempt to test >- $t->get_ok("//$unauth_userid:$password@/api/v1/sftp_server/$sftp_server_id/test_connection")->status_is(403); >- >- $t->get_ok("//$userid:$password@/api/v1/sftp_server/$sftp_server_id/test_connection") >- ->status_is( 200, 'SWAGGER3.2.4' ) >- ->content_is( '{"1_ftp_conn":{"err":"cannot connect to ' >- . $sftp_server->host >- . ': Name or service not known","msg":null,"passed":false}}', 'SWAGGER3.3.4' ); >- >- $schema->storage->txn_rollback; >-}; >+1; >-- >2.49.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39190
:
178555
|
178556
|
178557
|
178558
|
178559
|
178560
|
178561
|
178562
|
178563
|
178564
|
178565
|
178566
|
178567
|
178568
|
178569
|
178570
|
178571
|
179252
|
179253
|
179254
|
179255
|
179256
|
179257
|
179258
|
179259
|
179260
|
179261
|
179262
|
179263
|
179264
|
179265
|
179266
|
179267
|
179268
|
179396
|
179397
|
179398
|
179399
|
179400
|
179401
|
179402
|
179403
|
179404
|
179405
|
179406
|
179407
|
179408
|
179409
|
179410
|
179411
|
179412
|
179413
|
179589
|
179590
|
179591
|
179592
|
179593
|
179594
|
179595
|
179596
|
179597
|
179598
|
179599
|
179600
|
179601
|
179602
|
179603
|
179604
|
179605
|
179606
|
179646
|
179647
|
179648
|
179649
|
179650
|
179651
|
179652
|
179653
|
179654
|
179655
|
179656
|
179657
|
179658
|
179659
|
179660
|
179661
|
179662
|
179663
|
179992
|
179993
|
179994
|
179995
|
179996
|
179997
|
179998
|
179999
|
180000
|
180001
|
180002
|
180003
|
180004
|
180005
|
180006
|
180010
|
180011
|
180012
|
180013
|
180014
|
180015
|
180016
|
180017
|
180018
|
180019
|
180020
|
180021
|
180022
|
180023
|
180024
|
180025