BAIL_OUT('Set copy floating failed');
}
+# Test a batch update where some succeed and some fail.
+$resp = $editor->search_asset_copy([
+ {circ_lib => BR2_ID, status => 0, floating => undef},
+ {limit => 5, idlist => 1}
+]);
+ok(
+ $resp && scalar(@{$resp}) == 5,
+ 'Got 5 copies from branch 2'
+);
+undef($copies);
+push(@{$copies}, @{$resp});
+$resp = $editor->search_asset_copy([
+ {circl_lib => BR1_ID, status => 0},
+ {limit => 5, idlist => 1}
+]);
+ok(
+ $resp && scalar(@{$resp}) == 5,
+ 'Got 5 copies from branch 1'
+);
+push(@{$copies}, @{$resp});
+$resp = $U->simplereq(
+ 'open-ils.circ',
+ 'open-ils.circ.circulation.update_copy_inventory',
+ $authtoken,
+ {copy_list=>$copies}
+);
+is(
+ $resp->[0],
+ 5,
+ 'Updated inventory on 5 copies'
+);
+is(
+ $resp->[1],
+ 5,
+ 'Did not update inventory on 5 copies'
+);
+
# We could run 36 or more tests depending on what we find in the
# database, so we don't specify a number of tests.
done_testing();