Bugzilla – Attachment 166960 Details for
Bug 36831
Add support for .txt files to the KBART import tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36831: Add unit test
Bug-36831-Add-unit-test.patch (text/plain), 2.14 KB, created by
Matt Blenkinsop
on 2024-05-21 10:02:17 UTC
(
hide
)
Description:
Bug 36831: Add unit test
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-05-21 10:02:17 UTC
Size:
2.14 KB
patch
obsolete
>From 0fb95b43933a7725cb8ecedf6293802f74855ec5 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Tue, 21 May 2024 10:00:48 +0000 >Subject: [PATCH] Bug 36831: Add unit test > >prove t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t >--- > .../Koha/BackgroundJob/ImportKBARTFile.t | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t b/t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t >index 45a8ec821a..fbe0a7f30f 100755 >--- a/t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t >+++ b/t/db_dependent/Koha/BackgroundJob/ImportKBARTFile.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 7; >+use Test::More tests => 8; > use Test::MockModule; > > use Koha::Database; >@@ -111,7 +111,23 @@ Nature Astronomy,,2397-3366,2017-01,1,1,,,,https://www.nature.com/natastron,,4bb > ], > 'Line correctly identified' > ); >+}; >+ >+subtest 'identify_delimiter' => sub { >+ >+ plan tests => 1; >+ >+ my $file = { >+ filename => 'Test_file.txt', >+ 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 >+Nature Astronomy,,2397-3366,2017-01,1,1,,,,https://www.nature.com/natastron,,4bbb0,,fulltext,Hybrid (Open Choice),Nature Publishing Group UK,serial,,,,,,,,P' >+ ) >+ }; > >+ my $delimiter = Koha::BackgroundJob::ImportKBARTFile::identify_delimiter($file); >+ is($delimiter, ',', 'Comma delimiter identified'); > }; > > subtest 'create_title_hash_from_line_data' => sub { >-- >2.37.1 (Apple Git-137.1)
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 36831
:
166958
|
166959
|
166960
|
166961
|
166989
|
166990
|
166991
|
168431
|
168432
|
168433
|
168434
|
170549
|
170550
|
170551
|
170552
|
170562
|
170563
|
170564
|
170565
|
176319
|
176320
|
176321
|
176322
|
176323
|
176324
|
176325
|
176326
|
176347
|
179679
|
179680
|
179681
|
179682