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)
committerMason James <mtj@kohaaloha.com>
Tue, 24 Oct 2017 04:35:22 +0000 (17:35 +1300)
commit356047b920ddb96f587fea1631c64fbd6da8bc2d
tree29df025fb26431b7b46d5367e99bc1d5f4941609
parentcd397d30b3f4d9c93ee836bafec96927d154f91f
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: Mason James <mtj@kohaaloha.com>
C4/XISBN.pm
t/db_dependent/XISBN.t