adding an in-house use creation tester
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 27 Jan 2006 19:21:12 +0000 (19:21 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 27 Jan 2006 19:21:12 +0000 (19:21 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2865 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/support-scripts/test-scripts/checkout.pl
Open-ILS/src/support-scripts/test-scripts/in_house_use.pl [new file with mode: 0755]

index 61417e2..2998e58 100755 (executable)
@@ -8,13 +8,15 @@ require '../oils_header.pl';
 use vars qw/ $apputils $memcache $user $authtoken $authtime /;
 use strict; use warnings;
 
-err("usage: $0 <config> <oils_login_username> ".
+#----------------------------------------------------------------
+err("\nusage: $0 <config> <oils_login_username> ".
        " <oils_login_password> <patronid> <copy_barcode> [<type>]\n".
        "Where <type> 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 (executable)
index 0000000..489a60a
--- /dev/null
@@ -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 <config> <oils_username>  <oils_password> <copyid> <org_id> [<count>]\n".
+       "If <count> is defined, then <count> 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");
+}
+