Bugzilla – Attachment 167132 Details for
Bug 36935
BackgroundJob/ImportKBARTFile.t generates warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36935: Add unit test for error handling
Bug-36935-Add-unit-test-for-error-handling.patch (text/plain), 2.35 KB, created by
David Nind
on 2024-05-23 20:08:09 UTC
(
hide
)
Description:
Bug 36935: Add unit test for error handling
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-05-23 20:08:09 UTC
Size:
2.35 KB
patch
obsolete
>From d65d1a21e393bec0587697b4cdce9972bc1826da Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 23 May 2024 11:17:31 +0000 >Subject: [PATCH] Bug 36935: Add unit test for error handling > >prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../Koha/BackgroundJob/ImportKBARTFile.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t b/t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t >index 45a8ec821a..e0abbb283a 100755 >--- a/t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t >+++ b/t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t >@@ -19,6 +19,7 @@ use Modern::Perl; > > use Test::More tests => 7; > use Test::MockModule; >+use Test::Warn; > > use Koha::Database; > use Koha::BackgroundJobs; >@@ -76,7 +77,7 @@ subtest 'format_title' => sub { > > subtest 'read_file' => sub { > >- plan tests => 6; >+ plan tests => 7; > > my $file = { > filename => 'Test_file.csv', >@@ -112,6 +113,18 @@ Nature Astronomy,,2397-3366,2017-01,1,1,,,,https://www.nature.com/natastron,,4bb > 'Line correctly identified' > ); > >+ my $file2 = { >+ filename => 'Test_file2.csv', >+ file_content => encode_base64( >+ "publication_title,print_identifier,online_identifier,date_first_issue_online,num_first_vol_online,num_first_issue_online,date_last_issue_online,num_last_vol_online,num_last_issue_online,title_url,first_author,title_id,embargo_info,coverage_depth,coverage_notes,publisher_name,publication_type,date_monograph_published_print,date_monograph_published_online,monograph_volume,monograph_edition,first_editor,parent_publication_title_id,preceding_publication_title_id,access_type >+Nature Plants,,2055-0278,2015-01,1,1,,,,https://www.nature.com/nplants,,4aaa7,,fulltext,Hybrid (Open Choice),Nature Publishing Group UK,serial,,,,,,,,P,\"foo\"bar >+Nature Astronomy,,2397-3366,2017-01,1,1,,,,https://www.nature.com/natastron,,4bbb0,,fulltext,Hybrid (Open Choice),Nature Publishing Group UK,serial,,,,,,,,P" >+ ) >+ }; >+ warning_is { >+ Koha::BackgroundJob::ImportKBARTFile::read_file($file2); >+ } >+ '2023, EIQ - QUO character not allowed, 157', 'Error message correctly reported'; > }; > > subtest 'create_title_hash_from_line_data' => sub { >-- >2.39.2
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 36935
:
167078
|
167080
|
167088
|
167089
|
167099
|
167130
|
167131
|
167132
|
168326
|
168327
|
168328