From 4badce58a0e99d5f427724471ec27f87d013cf71 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 5 Apr 2022 10:44:25 -0400 Subject: [PATCH] LP#1967770: Fix test for cover image upload The cover image upload test assumes that it will be run from exactly one location, but that's not necessarily true. This commit uses FindBin to provide the right filesystem context for the test to find the files it needs. [Code by Galen, commit message by Mike] Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/live_t/34-lp1787968-cover-uploader.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/live_t/34-lp1787968-cover-uploader.t b/Open-ILS/src/perlmods/live_t/34-lp1787968-cover-uploader.t index 66ae4ee398..7e445fc022 100644 --- a/Open-ILS/src/perlmods/live_t/34-lp1787968-cover-uploader.t +++ b/Open-ILS/src/perlmods/live_t/34-lp1787968-cover-uploader.t @@ -8,6 +8,7 @@ use OpenILS::Utils::Fieldmapper; use LWP::UserAgent; use File::Fetch; use HTTP::Request::Common qw(POST); +use FindBin; diag("test image uploader"); @@ -38,7 +39,7 @@ my $req = POST( Content_Type => 'multipart/form-data', Content => [ # we're going for an image parse error - jacket_upload => [ '34-lp1787968-cover-uploader.t' ], + jacket_upload => [ "$FindBin::Bin/34-lp1787968-cover-uploader.t" ], bib_record => 1, ses => $authtoken ] @@ -53,7 +54,7 @@ $req = POST( $target, Content_Type => 'multipart/form-data', Content => [ - jacket_upload => [ '../../../web/images/green_check.png' ], + jacket_upload => [ "$FindBin::Bin/../../../web/images/green_check.png" ], bib_record => 1, ses => $authtoken ] -- 2.11.0