Bugzilla – Attachment 156314 Details for
Bug 34737
Enhance SIP2SortBinMapping to support additional match conditions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34737: (follow-up) Unit test for skipping bad lines
Bug-34737-follow-up-Unit-test-for-skipping-bad-lin.patch (text/plain), 2.70 KB, created by
Kyle M Hall (khall)
on 2023-09-28 11:01:20 UTC
(
hide
)
Description:
Bug 34737: (follow-up) Unit test for skipping bad lines
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-09-28 11:01:20 UTC
Size:
2.70 KB
patch
obsolete
>From d74985d6ae1f67556a5d94f7b2a33e3e700eb18e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 25 Sep 2023 11:39:22 +0100 >Subject: [PATCH] Bug 34737: (follow-up) Unit test for skipping bad lines > >We update the test rules set to include some malformed, empty and >comment lines. No actual tests are added, but the skipping is checked by >all other tests in this way. > >Signed-off-by: Toni Ford <Toni.Ford@newcastle.gov.uk> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/SIP/Transaction.t | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index cdbd303acdb..30ddfc182c8 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -5,6 +5,7 @@ > > use Modern::Perl; > use Test::More tests => 18; >+use Test::Warn; > > use Koha::Database; > use t::lib::TestBuilder; >@@ -975,13 +976,14 @@ subtest checkin_withdrawn => sub { > }; > > subtest _get_sort_bin => sub { >- plan tests => 5; >+ plan tests => 6; > > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $branch = $library->branchcode; > my $library2 = $builder->build_object( { class => 'Koha::Libraries' } ); > my $branch2 = $library2->branchcode; > >+ # Rules starts with malformed line, empty line and a comment to prove they are skipped > my $rules = <<"RULES"; > $branch:homebranch:ne:\$holdingbranch:X\r > $branch:effective_itemtype:eq:CD:0\r >@@ -992,7 +994,11 @@ $branch2:homebranch:ne:\$holdingbranch:X\r > $branch2:effective_itemtype:eq:CD:4\r > $branch2:itemcallnumber:>:600:5\r > $branch2:effective_itemtype:eq:BOOK:ccode:eq:TEEN:6\r >+# Comment line to skip\r >+\r >+$branch:homebranch:Z\r > RULES >+ > t::lib::Mocks::mock_preference( 'SIP2SortBinMapping', $rules ); > > my $item_cd = $builder->build_sample_item( >@@ -1018,6 +1024,13 @@ RULES > } > ); > >+ my $item_dvd = $builder->build_sample_item( >+ { >+ library => $library2->branchcode, >+ itype => 'DVD' >+ } >+ ); >+ > my $bin; > > # Set holdingbranch as though item returned to library other than homebranch (As AddReturn would) >@@ -1037,6 +1050,10 @@ RULES > > $bin = C4::SIP::ILS::Transaction::Checkin::_get_sort_bin( $item_book2, $library2->branchcode ); > is( $bin, '6', "Rules with multiple field matches" ); >+ >+ warnings_are { $bin = C4::SIP::ILS::Transaction::Checkin::_get_sort_bin( $item_dvd, $library2->branchcode ); } >+ ["Malformed preference line found: '$branch:homebranch:Z'"], >+ "Comments and blank lines are skipped, Malformed lines are warned and skipped"; > }; > > subtest item_circulation_status => sub { >-- >2.30.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 34737
:
155328
|
155329
|
155330
|
155360
|
155361
|
155362
|
155663
|
155664
|
155665
|
155666
|
156147
|
156148
|
156170
|
156171
|
156172
|
156173
|
156174
|
156175
|
156176
|
156177
| 156314 |
156315