Skip to content
Snippets Groups Projects
Commit 4282d275 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added tests for help

parent 6248f0b3
No related branches found
No related tags found
No related merge requests found
use v5.36;
use Test::Cmd;
use Test::More tests =>10;
use Test::More tests =>19;
use Path::Tiny;
my $perl = $^X;
my $testapp = Test::Cmd->new(
......@@ -24,13 +24,24 @@ use_ok("SLUB::LZA::TA::Crypt");
is(SLUB::LZA::TA::Crypt::encrypt("199fc76b9d086d8937976634e93413bcd005d941"), "839852bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f980ad83d39008ad638bc41e2345", "ta-tool, init, check encryption");
is(SLUB::LZA::TA::Crypt::decrypt("839852bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f980ad83d39008ad638bc41e2345"), "199fc76b9d086d8937976634e93413bcd005d941", "ta-tool, init, check encryption");
ok($testapp, "init 'ta-tool'");
foreach my $param ("help init", "init -h", "init --help") {
$testapp->run(args => $param);
#say "STDOUT:",$testapp->stdout;
#say "STDERR:",$testapp->stderr;
like($testapp->stdout, qr/this usage screen/, "ta-tool $param, stdout");
like($testapp->stderr, qr/^$/, "ta-tool $param, stderr");
is($? >> 8, 0, "ta-tool $param, exit status");
}
$testapp->run(
stdin => <<_EOF_,
lza
199fc76b9d086d8937976634e93413bcd005d941
199fc76b9d086d8937976634e93413bcd005d941
_EOF_
args => '-v init -e sdvlzaamtestfotothek01.slub-dresden.de -l /tmp',
args => 'init -v -e sdvlzaamtestfotothek01.slub-dresden.de',
#args => 'init -e sdvlzaamtestfotothek01.slub-dresden.de -l /tmp',
);
#say "STDOUT:",$testapp->stdout;
#say "STDERR:",$testapp->stderr;
......@@ -44,7 +55,6 @@ is($config, <<_EXP_, "ta-tool init, config file as expected");
elasticsearch_host: sdvlzaamtestfotothek01.slub-dresden.de
elasticsearch_port: 9200
http_only: ~
logdir: /tmp
password: 839852bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f980ad83d39008ad638bc41e2345
user: lza
_EXP_
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment