App-Photobear

 view release on metacpan or  search on metacpan

t/01-photo-library.t  view on Meta::CPAN

use Test::More;
use FindBin qw($RealBin);
use_ok('App::Photobear');
my $api_check = 'a18c2f3d-1b2c-4d3e-8f4a-5b6c7d8e9f0a';

my $config = App::Photobear::loadconfig("$RealBin/photobear.ini");

ok($config->{"api_key"}, "API key is set");
ok($config->{"api_key"} eq "$api_check", "API key is correct: $api_check");

my $got = App::Photobear::url_exists("https://www.github.com/telatin.png");
ok(defined $got, "Answer received: $got [ignoring failure]");

my $badgot = App::Photobear::url_exists("https://www.telatin.com/sadly-not-existing.png");
ok($badgot == 0, "Answer received: $badgot (expecting failure)");
done_testing();

t/02-photo-app.t  view on Meta::CPAN

if ($^O =~ /Win32/) {
    plan skip_all => "Test not supported under Windows";
    exit;
}
my $perl = $^X;
# Set DEBUG variable
$ENV{PHOTOBEAR_DEBUG} = 1;
$ENV{PHOTOBEAR_TEST} = 1;
$ENV{PHOTOBEAR_API_KEY} = "C0FFEE-C0FFEE-C0FFEE-C0FFEE";
my $system_temp = $ENV{TEMP} || $ENV{TMP} || '/tmp';
my $cmd = "$perl -Ilib bin/photobear --verbose -o \"$system_temp\" vectorization https://www.telatin.com/core-people.png";
my $out = `$cmd`;
ok(defined $?, "Command executed: $cmd [$?]");

done_testing();



( run in 1.076 second using v1.01-cache-2.11-cpan-df04353d9ac )