Bug 19440: Identify overlimit problems in XISBN tests
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 9 Oct 2017 18:36:41 +0000 (15:36 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 9 Oct 2017 19:15:52 +0000 (16:15 -0300)
commite90874241808354777cc1c27ad3ad106ffdc7cd4
treecce002069635a64ca446d2a6c8da41980c443ba1
parent5ac69e3a19bb3a30554d41f862516bb92a70508a
Bug 19440: Identify overlimit problems in XISBN tests

This patch makes C4::XISBN::get_xisbns() return an errors hashref
including information of the failing fetches from xisbn services.

It tackles the situation of XISBN, which in some cases returns 'overlimit'
errors.

The patch makes the relevant functions check if the response->{stat} string
is 'ok' and returns the string in $errors otherwise.

This only happens when in list context. This allows to fix the randomly failing
tests while keeping the current behaviour.

All this code should be rewritten. It does the job bug doesn't have problems handling
or reoprting. This is just a band aid.

To test:
- Make sure
 k$ prove t/db_dependent/XISBN.t
=> SUCCESS :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/XISBN.pm
t/db_dependent/XISBN.t