summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/00-load.t9
-rw-r--r--t/01-login.t17
-rw-r--r--t/41-auditDIDs.t26
-rw-r--r--t/61-getDID.t29
-rw-r--r--t/lib/test_account.pl22
-rw-r--r--t/pod-coverage.t18
-rw-r--r--t/pod.t12
7 files changed, 133 insertions, 0 deletions
diff --git a/t/00-load.t b/t/00-load.t
new file mode 100644
index 0000000..7195e1e
--- /dev/null
+++ b/t/00-load.t
@@ -0,0 +1,9 @@
+#!perl -T
+
+use Test::More tests => 1;
+
+BEGIN {
+ use_ok( 'Net::GlobalPOPs::MediaServicesAPI' );
+}
+
+diag( "Testing Net::GlobalPOPs::MediaServicesAPI $Net::GlobalPOPs::MediaServicesAPI::VERSION, Perl $], $^X" );
diff --git a/t/01-login.t b/t/01-login.t
new file mode 100644
index 0000000..5a92d6c
--- /dev/null
+++ b/t/01-login.t
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w
+
+use Test::More;
+require 't/lib/test_account.pl';
+
+my($login, $password) = test_account_or_skip;
+plan tests => 2;
+
+use_ok 'Net::GlobalPOPs::MediaServicesAPI';
+
+my $gp = Net::GlobalPOPs::MediaServicesAPI->new('login' => $login,
+ 'password' => $password );
+
+#eww. what is the right, TEST_VERBOSE-aware way to do this
+warn Net::GlobalPOPs::MediaServicesAPI->errstr unless $gp;
+
+ok( $gp, 'Login sucessful' );
diff --git a/t/41-auditDIDs.t b/t/41-auditDIDs.t
new file mode 100644
index 0000000..4bb8907
--- /dev/null
+++ b/t/41-auditDIDs.t
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -w
+#
+$Net::SSLeay::ssl_version = 10;
+
+use Test::More; # skip_all => 'wtf';
+
+require 't/lib/test_account.pl';
+
+my($login, $password) = test_account_or_skip();
+plan tests => 2;
+
+use_ok 'Net::GlobalPOPs::MediaServicesAPI';
+
+my $debug = $ENV{TEST_VERBOSE};
+
+my $gp = Net::GlobalPOPs::MediaServicesAPI->new( 'login' => $login,
+ 'password' => $password,
+ 'debug' => $debug,
+ );
+my $return = $gp->auditDIDs();
+
+use Data::Dumper;
+diag( Dumper($return) ) if $debug;
+
+#XXX test some things about the return...
+ok( $return, 'auditDIDs returned something' );
diff --git a/t/61-getDID.t b/t/61-getDID.t
new file mode 100644
index 0000000..e2d9a0e
--- /dev/null
+++ b/t/61-getDID.t
@@ -0,0 +1,29 @@
+#!/usr/bin/perl -w
+
+#BEGIN {
+# $Net::HTTPS::Any::skip_NetSSLeay = 1;
+# $Net::HTTPS::Any::skip_NetSSLeay = 1;
+#}
+
+use Test::More;
+
+require 't/lib/test_account.pl';
+
+my($login, $password) = test_account_or_skip();
+plan tests => 2;
+
+use_ok 'Net::GlobalPOPs::MediaServicesAPI';
+
+my $debug = $ENV{TEST_VERBOSE};
+
+my $gp = Net::GlobalPOPs::MediaServicesAPI->new( 'login' => $login,
+ 'password' => $password,
+ 'debug' => $debug,
+ );
+my $return = $gp->getDID();
+
+use Data::Dumper;
+diag( Dumper($return) ) if $debug;
+
+#XXX test some things about the return...
+ok( $return, 'auditDIDs returned something' );
diff --git a/t/lib/test_account.pl b/t/lib/test_account.pl
new file mode 100644
index 0000000..4b316db
--- /dev/null
+++ b/t/lib/test_account.pl
@@ -0,0 +1,22 @@
+use Test::More;
+
+sub test_account_or_skip {
+ my($login, $password) = test_account();
+
+ unless( defined $login ) {
+ plan skip_all => "No test account";
+ }
+
+ return($login, $password);
+}
+
+sub test_account {
+ open TEST_ACCOUNT, "t/test_account" or return;
+ my($login, $password) = <TEST_ACCOUNT>;
+ chomp $login;
+ chomp $password;
+
+ return($login, $password);
+}
+
+1;
diff --git a/t/pod-coverage.t b/t/pod-coverage.t
new file mode 100644
index 0000000..fc40a57
--- /dev/null
+++ b/t/pod-coverage.t
@@ -0,0 +1,18 @@
+use strict;
+use warnings;
+use Test::More;
+
+# Ensure a recent version of Test::Pod::Coverage
+my $min_tpc = 1.08;
+eval "use Test::Pod::Coverage $min_tpc";
+plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
+ if $@;
+
+# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
+# but older versions don't recognize some common documentation styles
+my $min_pc = 0.18;
+eval "use Pod::Coverage $min_pc";
+plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
+ if $@;
+
+all_pod_coverage_ok();
diff --git a/t/pod.t b/t/pod.t
new file mode 100644
index 0000000..ee8b18a
--- /dev/null
+++ b/t/pod.t
@@ -0,0 +1,12 @@
+#!perl -T
+
+use strict;
+use warnings;
+use Test::More;
+
+# Ensure a recent version of Test::Pod
+my $min_tp = 1.22;
+eval "use Test::Pod $min_tp";
+plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
+
+all_pod_files_ok();