[Koha-bugs] [Bug 9842] SIP tests : fix for 07hold.t on Cancel Hold

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Apr 20 01:02:38 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9842

Chris Cormack <chris at bigballofwax.co.nz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #16380|0                           |1
        is obsolete|                            |

--- Comment #2 from Chris Cormack <chris at bigballofwax.co.nz> ---
Created attachment 17563
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17563&action=edit
Bug 9842: SIP tests, fix for 07hold.t on Cancel Hold

Fixes tests resulting in a "No such hold on patron record" error
when it was not true.

When running the SIP tests, 07hold.t returns errors.

ERROR 1:
patron (1X981)'
line 204.
DU ROI SALOMON|AOVIL|AY3AZEA76' doesn't match pattern
'(?-xism:^161Y\d{8} {4}\d{6})'

Here, the most important return value is the "1" after "16",
indicating a success.
And indeed, the hold is correctly recorded in Koha.
The following character, indicating the "available" status (and which
can be of "Y" or "N" value), is fed by the "available" method in
C4/SIP/ILS/Item.pm which is not totally functionnal yet.
So, the question is :
- should the test gives a OK result by accepting N or Y as long as we
get a 161 and not a 160?
- should we keep this as it is? (seems safer and cleaner, if we want
to respect the SIP protocol the item should be marked as available if
it is... I'll go this way and won't touch this in this patch)

ERROR 2:
line 204.
patron record.|AY6AZEA73' doesn't match pattern '(?-xism:^161[NY]\d{8}
{4}\d{6})'

Here, the hold actually exists, but the "No such hold on patron
record" result is caused by an error in the perl script of ILS.pm
Tests like "unless ($trans->ok)" should be written unless
"($trans->ok(1))".

ERROR 3:
(1X999)'
line 204.
patron record.|AY0AZEA70' doesn't match pattern '(?-xism:^161[NY]\d{8}
{4}\d{6})'

Proposed patch : removes the ERRORS #2 and #3

Once these errors disappear, another one replaces them:
line 204.
SALOMON|AOVIL|AFHold Cancelled.|AY8AZE623' doesn't match pattern
'(?-xism:^160N\d{8} {4}\d{6})'
The lack of efficient return value when calling CancelReserve is
causing this. I'd rather resolve this in another patch once this one
has been validated.

TEST PLAN :
1) In "C4/SIP/t", configure the SIPtest.pm file.
2) Configure your SIPconfig.xml if needed.
3) Start your SIP server.
4) In "C4/SIP/t", do a "make test" (see the README file for more
informations)
You can also run the 07hold.t only. Still, running everything can help
to ensure that your SIPtest.pm is well configured.

Before the patch, this plan should generate 3 errors for 7hold. After
the patch it will generate 2 errors.

Signed-off-by: Chris Cormack <chris at bigballofwax.co.nz>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list