SIP tests for renew and renew_all.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
84ba43c32e
commit
dd06b59fdc
|
|
@ -10,14 +10,14 @@ use Sip::Constants qw(:all);
|
|||
use SIPtest qw(:basic :user1 :item1);
|
||||
|
||||
my $checkout_template = {
|
||||
id => "Renew: prep: check out item ($item_barcode) to patron ($user_barcode)",
|
||||
id => "Renew: prep: check out item ($item_barcode) to patron ($user_barcode)",
|
||||
msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item_barcode|AC|",
|
||||
pat => qr/^121NNY$datepat/,
|
||||
fields => [],
|
||||
};
|
||||
|
||||
my $checkin_template = {
|
||||
id => "Renew: prep: check in item ($item_barcode)",
|
||||
id => "Renew: cleanup: check in item ($item_barcode)",
|
||||
msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item_barcode|AC$password|",
|
||||
pat => qr/^101YNN$datepat/,
|
||||
fields => [],
|
||||
|
|
@ -39,9 +39,9 @@ my $checkin_template = {
|
|||
#
|
||||
|
||||
my $renew_test_template = {
|
||||
id => "Renew: item ($item_barcode) to patron ($user_barcode), renewal OK, no 3rd party, no fees",
|
||||
id => "Renew: RENEW 1, item ($item_barcode) to patron ($user_barcode), renewal OK, no 3rd party, no fees",
|
||||
msg => "29NN20060102 084236 AO$instid|AA$user_barcode|AB$item_barcode|",
|
||||
pat => qr/^301YNN$datepat/,
|
||||
pat => qr/^301Y[UN][UN]$datepat/,
|
||||
fields => [
|
||||
$SIPtest::field_specs{(FID_INST_ID)},
|
||||
$SIPtest::field_specs{(FID_SCREEN_MSG)},
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ my @checkin_templates = (
|
|||
);
|
||||
|
||||
my $renew_all_test_template = {
|
||||
id => "Renew All: patron ($user_barcode) with 1 item checked out, no patron password",
|
||||
id => "Renew All: patron ($user_barcode) with 1 item ($item_barcode) checked out, no patron password",
|
||||
msg => "6520060102 084236AO$instid|AA$user_barcode|",
|
||||
pat => qr/^66100010000$datepat/,
|
||||
fields => [
|
||||
|
|
@ -63,19 +63,17 @@ my @tests = (
|
|||
|
||||
my $test;
|
||||
|
||||
#$test = clone($renew_all_test_template);
|
||||
#$test->{id} = 'Renew All: Valid patron, two items checked out';
|
||||
#$test->{pat} = qr/^66100020000$datepat/;
|
||||
#foreach my $i (0 .. (scalar @{$test->{fields}})-1) {
|
||||
# my $field = $test->{fields}[$i];
|
||||
#
|
||||
# if ($field->{field} eq FID_RENEWED_ITEMS) {
|
||||
# $field->{pat} = qr/^$item_barcode\|$item2_barcode$/;
|
||||
# }
|
||||
#}
|
||||
#
|
||||
#push @tests, $checkout_templates[0], $checkout_templates[1],
|
||||
# $renew_all_test_template, $checkin_templates[0], $checkin_templates[1];
|
||||
$test = clone($renew_all_test_template);
|
||||
$test->{id} = 'Renew All: Valid patron, two items checked out';
|
||||
$test->{pat} = qr/^66100020000$datepat/;
|
||||
foreach my $i (0 .. (scalar @{$test->{fields}})-1) {
|
||||
my $field = $test->{fields}[$i];
|
||||
if ($field->{field} eq FID_RENEWED_ITEMS) {
|
||||
$field->{pat} = qr/^$item_barcode\|$item2_barcode$/;
|
||||
}
|
||||
}
|
||||
|
||||
#push @tests, @checkout_templates[0..1], $renew_all_test_template, @checkin_templates[0..1];
|
||||
|
||||
$test = clone($renew_all_test_template);
|
||||
$test->{id} = 'Renew All: valid patron, invalid patron password';
|
||||
|
|
|
|||
Loading…
Reference in New Issue