From: Jason Etheridge Date: Tue, 3 Sep 2013 18:30:22 +0000 (-0400) Subject: add src/Pg/live_t/ X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=64a503f12cd1094636818d4dd5725d73905517bd;p=evergreen%2Fmasslnc.git add src/Pg/live_t/ for tests that assume stock test data Moving 0824.item_import_defaults.pg from t/ to live_t/ Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/src/sql/Pg/live_t/0824.item_import_defaults.pg b/Open-ILS/src/sql/Pg/live_t/0824.item_import_defaults.pg new file mode 100644 index 0000000000..0828c1eb58 --- /dev/null +++ b/Open-ILS/src/sql/Pg/live_t/0824.item_import_defaults.pg @@ -0,0 +1,113 @@ +\set ECHO +\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 + +-- let's do this thing +BEGIN; + +SELECT plan(2); + +INSERT INTO actor.org_unit_setting (org_unit,name,value) VALUES +(4,'vandelay.item.barcode.auto','true'), +(4,'vandelay.item.circ_modifier.default','"BOOK"'), +(4,'vandelay.item.call_number.auto','true'); + +INSERT INTO vandelay.bib_queue (owner,name,item_attr_def) +VALUES ( + 1, + 'tmp test queue '||RANDOM(), + (SELECT id FROM vandelay.import_item_attr_definition WHERE name = 'Evergreen 852 export format') -- Hope the schema is stock... +); + +INSERT INTO vandelay.queued_bib_record (marc,queue) +VALUES ( + $$ +00663ncm a2200229Ia 4500 +ocm2061267120090604115400.0 +891108s1989 mnupp i n eng d +HL00361126 :$14.95 +TULTULUtOrBLW +MRQA +782.421630264S6986 1989 +Songs of the 60's :piano, vocal, guitar. +Winona, MN :H. Leonard,c1989. +1 score (175 p.) :ill. ;31 cm. +Decade series +With a preface by Stanley Green. +Popular music1961-1970 +Songs of the sixties. +DE (Series) +StacksBR1CN-labelBR1BC1234567890Available +*SOT60S99000 +$$, + CURRVAL('vandelay.queue_id_seq') +); + +/* +SELECT * FROM vandelay.ingest_items( + CURRVAL('vandelay.queued_record_id_seq'), + (SELECT item_attr_def FROM vandelay.bib_queue WHERE id = CURRVAL('vandelay.queue_id_seq')) +); +*/ + +SELECT isnt_empty( + $$SELECT * FROM vandelay.ingest_items( + CURRVAL('vandelay.queued_record_id_seq'), + (SELECT item_attr_def FROM vandelay.bib_queue WHERE id = CURRVAL('vandelay.queue_id_seq')) + ) WHERE circ_modifier = 'BOOK' AND barcode = 'BC1234567890';$$, + 'Should have a row with barcode BC1234567890 and auto-circ mod of BOOK' +); + + +INSERT INTO vandelay.queued_bib_record (marc,queue) +VALUES ( + $$ +00663ncm a2200229Ia 4500 +ocm2061267120090604115400.0 +891108s1989 mnupp i n eng d +HL00361126 :$14.95 +TULTULUtOrBLW +MRQA +782.421630264S6986 1989 +Songs of the 60's :piano, vocal, guitar. +Winona, MN :H. Leonard,c1989. +1 score (175 p.) :ill. ;31 cm. +Decade series +With a preface by Stanley Green. +Popular music1961-1970 +Songs of the sixties. +DE (Series) +StacksBR1BR1Available +*SOT60S99000 +$$, + CURRVAL('vandelay.queue_id_seq') +); + +/* +SELECT * FROM vandelay.ingest_items( + CURRVAL('vandelay.queued_record_id_seq'), + (SELECT item_attr_def FROM vandelay.bib_queue WHERE id = CURRVAL('vandelay.queue_id_seq')) +); +*/ + +SELECT isnt_empty( + $$SELECT * FROM vandelay.ingest_items( + CURRVAL('vandelay.queued_record_id_seq'), + (SELECT item_attr_def FROM vandelay.bib_queue WHERE id = CURRVAL('vandelay.queue_id_seq')) + ) WHERE circ_modifier = 'BOOK' AND barcode IS NULL AND call_number is NULL; -- null barcode means "use auto"$$, + 'Should have a row with a NULL barcode and call number, auto-circ mod of BOOK' +); + +SELECT * FROM finish(); +ROLLBACK; + diff --git a/Open-ILS/src/sql/Pg/live_t/README b/Open-ILS/src/sql/Pg/live_t/README new file mode 100644 index 0000000000..307830ea6c --- /dev/null +++ b/Open-ILS/src/sql/Pg/live_t/README @@ -0,0 +1 @@ +For the tests we put here, we can assume the stock test data is loaded. diff --git a/Open-ILS/src/sql/Pg/t/0824.item_import_defaults.pg b/Open-ILS/src/sql/Pg/t/0824.item_import_defaults.pg deleted file mode 100644 index 0828c1eb58..0000000000 --- a/Open-ILS/src/sql/Pg/t/0824.item_import_defaults.pg +++ /dev/null @@ -1,113 +0,0 @@ -\set ECHO -\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 - --- let's do this thing -BEGIN; - -SELECT plan(2); - -INSERT INTO actor.org_unit_setting (org_unit,name,value) VALUES -(4,'vandelay.item.barcode.auto','true'), -(4,'vandelay.item.circ_modifier.default','"BOOK"'), -(4,'vandelay.item.call_number.auto','true'); - -INSERT INTO vandelay.bib_queue (owner,name,item_attr_def) -VALUES ( - 1, - 'tmp test queue '||RANDOM(), - (SELECT id FROM vandelay.import_item_attr_definition WHERE name = 'Evergreen 852 export format') -- Hope the schema is stock... -); - -INSERT INTO vandelay.queued_bib_record (marc,queue) -VALUES ( - $$ -00663ncm a2200229Ia 4500 -ocm2061267120090604115400.0 -891108s1989 mnupp i n eng d -HL00361126 :$14.95 -TULTULUtOrBLW -MRQA -782.421630264S6986 1989 -Songs of the 60's :piano, vocal, guitar. -Winona, MN :H. Leonard,c1989. -1 score (175 p.) :ill. ;31 cm. -Decade series -With a preface by Stanley Green. -Popular music1961-1970 -Songs of the sixties. -DE (Series) -StacksBR1CN-labelBR1BC1234567890Available -*SOT60S99000 -$$, - CURRVAL('vandelay.queue_id_seq') -); - -/* -SELECT * FROM vandelay.ingest_items( - CURRVAL('vandelay.queued_record_id_seq'), - (SELECT item_attr_def FROM vandelay.bib_queue WHERE id = CURRVAL('vandelay.queue_id_seq')) -); -*/ - -SELECT isnt_empty( - $$SELECT * FROM vandelay.ingest_items( - CURRVAL('vandelay.queued_record_id_seq'), - (SELECT item_attr_def FROM vandelay.bib_queue WHERE id = CURRVAL('vandelay.queue_id_seq')) - ) WHERE circ_modifier = 'BOOK' AND barcode = 'BC1234567890';$$, - 'Should have a row with barcode BC1234567890 and auto-circ mod of BOOK' -); - - -INSERT INTO vandelay.queued_bib_record (marc,queue) -VALUES ( - $$ -00663ncm a2200229Ia 4500 -ocm2061267120090604115400.0 -891108s1989 mnupp i n eng d -HL00361126 :$14.95 -TULTULUtOrBLW -MRQA -782.421630264S6986 1989 -Songs of the 60's :piano, vocal, guitar. -Winona, MN :H. Leonard,c1989. -1 score (175 p.) :ill. ;31 cm. -Decade series -With a preface by Stanley Green. -Popular music1961-1970 -Songs of the sixties. -DE (Series) -StacksBR1BR1Available -*SOT60S99000 -$$, - CURRVAL('vandelay.queue_id_seq') -); - -/* -SELECT * FROM vandelay.ingest_items( - CURRVAL('vandelay.queued_record_id_seq'), - (SELECT item_attr_def FROM vandelay.bib_queue WHERE id = CURRVAL('vandelay.queue_id_seq')) -); -*/ - -SELECT isnt_empty( - $$SELECT * FROM vandelay.ingest_items( - CURRVAL('vandelay.queued_record_id_seq'), - (SELECT item_attr_def FROM vandelay.bib_queue WHERE id = CURRVAL('vandelay.queue_id_seq')) - ) WHERE circ_modifier = 'BOOK' AND barcode IS NULL AND call_number is NULL; -- null barcode means "use auto"$$, - 'Should have a row with a NULL barcode and call number, auto-circ mod of BOOK' -); - -SELECT * FROM finish(); -ROLLBACK; -