From 3d81c78f8d27dd840dc1c2dc87970b5b41f66c8f Mon Sep 17 00:00:00 2001 From: Jens Steidl <Jens.Steidl@slub-dresden.de> Date: Tue, 13 Oct 2020 11:20:08 +0200 Subject: [PATCH] - removed test cases for getFileName() - updated related subs --- t/slubsipbuilderbagit.t | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/t/slubsipbuilderbagit.t b/t/slubsipbuilderbagit.t index 886f5b1..cd452c8 100644 --- a/t/slubsipbuilderbagit.t +++ b/t/slubsipbuilderbagit.t @@ -3,7 +3,7 @@ use strict; use warnings; use diagnostics; -use Test::More tests => 126; +use Test::More tests => 123; use Test::Output; use Test::Exception; use Test::File; @@ -22,7 +22,7 @@ sub workaroundBagInfoTXT($$$){ my $file_path = $_[0]; my $key = $_[1]; my $value = $_[2]; - my $file_name = SLUB::LZA::SIPBuilderBagIt::getFileName($file_path); + my $file_name = path($file_path)->basename(); # read a data file into an array open my $handle, '<', $file_path; @@ -47,7 +47,7 @@ sub workaroundTagmanifestMD5($$$){ my $file_path = $_[0]; my $key = $_[1]; my $value = $_[2]; - my $file_name = SLUB::LZA::SIPBuilderBagIt::getFileName($file_path); + my $file_name = path($file_path)->basename(); # read a data file into an array open my $handle, '<', $file_path; @@ -72,7 +72,7 @@ sub workaroundTagmanifestSHA512($$$){ my $file_path = $_[0]; my $key = $_[1]; my $value = $_[2]; - my $file_name = SLUB::LZA::SIPBuilderBagIt::getFileName($file_path); + my $file_name = path($file_path)->basename(); # read a data file into an array open my $handle, '<', $file_path; @@ -763,10 +763,6 @@ is(equalFilesByIgnoringCRLF_LF($output_bubbleFilePath, $input_bubbleFilePath), 1 is(equalFilesByIgnoringCRLF_LF($output_sameModsFilePath, $input_modsFilePath), 1, "copyFilesToMeta() file $input_modsFilePath is identical to $output_sameModsFilePath"); is(equalFilesByIgnoringCRLF_LF($output_sameRightsFilePath, $input_rightsFilePath), 1, "copyFilesToMeta() file $input_rightsFilePath is identical to $output_sameRightsFilePath"); # -is(SLUB::LZA::SIPBuilderBagIt::getFileName($input_bubbleFilePath), "bubble.xml", "getFileName()"); -throws_ok{ SLUB::LZA::SIPBuilderBagIt::getFileName(undef); } qr/path with file name is not defined/, "getFileName(\$file_name), file_name undef"; -throws_ok{ SLUB::LZA::SIPBuilderBagIt::getFileName(""); } qr/invalid parameters/, "getFileName(), invalid parameters"; -# my $xsdName = "rights1.xsd"; my $input_rights = path(__FILE__)->parent->parent->child('export_dir_kitodo')->child('bagit')->child("rights"); is(SLUB::LZA::SIPBuilderBagIt::validateRightsXML($input_rights . "/Fallbeispiel-01.xml", $xsdName), 1, "validateRightsXML() Fallbeispiel-01.xml according to $xsdName"); -- GitLab