File: 04-flickr_authuri.t

package info (click to toggle)
libflickr-api-perl 1.29-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 464 kB
  • sloc: perl: 1,471; makefile: 22
file content (46 lines) | stat: -rw-r--r-- 1,011 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use strict;
use warnings;
use Test::More;
use Data::Dumper;
use Storable;

use Flickr::API;

if (defined($ENV{MAKETEST_FLICKR_CFG})) {
	plan( tests => 5 );
}
else {
	plan(skip_all => 'These tests require that MAKETEST_FLICKR_CFG points to a valid config, see README.');
}

my $config_file  = $ENV{MAKETEST_FLICKR_CFG};
my $config_ref;
my $fileflag=0;
if (-r $config_file) { $fileflag = 1; }
is($fileflag, 1, "Is the config file: $config_file, readable?");


SKIP: {

	skip "Skipping request_auth_url tests, flickr config isn't there or is not readable", 4
	  if $fileflag == 0;

	my $api = Flickr::API->import_storable_config($config_file);
	isa_ok($api, 'Flickr::API');

	is($api->is_oauth, 0, 'Does Flickr::API object identify as Flickr');

	like($api->{api_key}, qr/[0-9a-f]+/i,
		 "Did we get a hexadecimal api key in the config");

	like($api->{api_secret}, qr/[0-9a-f]+/i,
		 "Did we get a hexadecimal api secret in the config");


} #skip request_auth_url tests


# Local Variables:
# mode: Perl
# End: