From d0548a3da2e6941ee195ee2eb916d1f1199775bc Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 27 Jan 2006 19:21:12 +0000 Subject: [PATCH] adding an in-house use creation tester git-svn-id: svn://svn.open-ils.org/ILS/trunk@2865 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../support-scripts/test-scripts/checkout.pl | 5 +- .../test-scripts/in_house_use.pl | 50 +++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100755 Open-ILS/src/support-scripts/test-scripts/in_house_use.pl diff --git a/Open-ILS/src/support-scripts/test-scripts/checkout.pl b/Open-ILS/src/support-scripts/test-scripts/checkout.pl index 61417e2beb..2998e58dac 100755 --- a/Open-ILS/src/support-scripts/test-scripts/checkout.pl +++ b/Open-ILS/src/support-scripts/test-scripts/checkout.pl @@ -8,13 +8,15 @@ require '../oils_header.pl'; use vars qw/ $apputils $memcache $user $authtoken $authtime /; use strict; use warnings; -err("usage: $0 ". +#---------------------------------------------------------------- +err("\nusage: $0 ". " []\n". "Where is one of:\n". "\t'permit' to run the permit only\n". "\t'noncat_permit' to run the permit script against a noncat item\n". "\t'noncat' to check out a noncat item\n". "\tblahk to do a regular checkout\n" ) unless $ARGV[4]; +#---------------------------------------------------------------- my $config = shift; my $username = shift; @@ -37,7 +39,6 @@ go(); #---------------------------------------------------------------- - sub do_permit { my( $patronid, $barcode, $noncat ) = @_; diff --git a/Open-ILS/src/support-scripts/test-scripts/in_house_use.pl b/Open-ILS/src/support-scripts/test-scripts/in_house_use.pl new file mode 100755 index 0000000000..489a60a494 --- /dev/null +++ b/Open-ILS/src/support-scripts/test-scripts/in_house_use.pl @@ -0,0 +1,50 @@ +#!/usr/bin/perl + +#---------------------------------------------------------------- +# Code for testing the container API +#---------------------------------------------------------------- + +require '../oils_header.pl'; +use vars qw/ $apputils $memcache $user $authtoken $authtime /; +use strict; use warnings; + +#---------------------------------------------------------------- +err("\nusage: $0 []\n". + "If is defined, then in-house uses will be ". + "created for the copy, otherwise 1 is created" ) unless $ARGV[4]; +#---------------------------------------------------------------- + +my $config = shift; +my $username = shift; +my $password = shift; +my $copyid = shift; +my $location = shift; +my $count = shift || 1; + +my $method = 'open-ils.circ.in_house_use.create'; + +sub go { + osrf_connect($config); + oils_login($username, $password); + do_in_house_use($copyid, $location, $count); + oils_logout(); +} + +go(); + +#---------------------------------------------------------------- + + +sub do_in_house_use { + my( $copyid, $location, $count ) = @_; + my $resp = simplereq( + 'open-ils.circ', + 'open-ils.circ.in_house_use.create', $authtoken, + copyid => $copyid, + location => $location, + count => $count ); + + oils_event_die($resp); + printl("Successfully created " . scalar(@$resp) . " in house use actions"); +} + -- 2.43.2