\set ECHO none \set QUIET 1 -- Turn off echo and keep things quiet. -- Format the output for nice TAP. \pset format unaligned \pset tuples_only true \pset pager -- Revert all changes on failure. \set ON_ERROR_ROLLBACK 1 \set ON_ERROR_STOP true \set QUIET 1 -- Load the TAP functions. BEGIN; -- Plan the tests. SELECT plan(3); SELECT is( fail_part, NULL, 'Checkout test Available succeeds' ) FROM action.item_user_circ_test(4, 1, 1); -- is_available defaults to false INSERT into config.copy_status (id, name) VALUES (101, 'lp1464709'); UPDATE asset.copy SET status = 101 WHERE id = 1; SELECT is( fail_part, 'asset.copy.status', 'Checkout test is_available=false fails' ) FROM action.item_user_circ_test(4, 1, 1); UPDATE config.copy_status SET is_available = TRUE WHERE name = 'lp1464709'; SELECT is( fail_part, NULL, 'Checkout test is_available=true succeeds' ) FROM action.item_user_circ_test(4, 1, 1); -- Finish the tests and clean up. SELECT * FROM finish(); ROLLBACK;