aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2015-02-13 21:10:41 +0100
committerAngelo Naselli <anaselli@linux.it>2015-02-13 21:10:41 +0100
commit7e11b8d8d6e954632990c83d5a787c945ac2796a (patch)
tree69244db168b08e3ca5006a14d36668f15d4153e7 /t
parent9aafbff3d7d2f018fbbaa315760315130e8799e6 (diff)
downloadcolin-keep-7e11b8d8d6e954632990c83d5a787c945ac2796a.tar
colin-keep-7e11b8d8d6e954632990c83d5a787c945ac2796a.tar.gz
colin-keep-7e11b8d8d6e954632990c83d5a787c945ac2796a.tar.bz2
colin-keep-7e11b8d8d6e954632990c83d5a787c945ac2796a.tar.xz
colin-keep-7e11b8d8d6e954632990c83d5a787c945ac2796a.zip
used dbus timedated api for backend (timezone, RTC and time)
Diffstat (limited to 't')
-rw-r--r--t/04-Shared_TimeZone.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/04-Shared_TimeZone.t b/t/04-Shared_TimeZone.t
index 26f9bfc..f11bb2c 100644
--- a/t/04-Shared_TimeZone.t
+++ b/t/04-Shared_TimeZone.t
@@ -2,6 +2,8 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
use Test::More;
+use Data::Dumper;
+use Time::Piece;
BEGIN {
use_ok( 'AdminPanel::Shared::TimeZone' ) || print "AdminPanel::Shared::TimeZone failed!\n";
@@ -11,9 +13,21 @@ BEGIN {
is( $tz->get_timezone_prefix(), '/usr/share/zoneinfo', 'get_timezone_prefix' );
ok (my @l = $tz->getTimeZones(), 'getTimeZones');
ok (my $h = $tz->readConfiguration(), 'readConfiguration');
+ diag Dumper($h);
ok (my $s = $tz->ntpCurrentServer(), 'currentNTPServer');
diag "ntpCurrentServer got: < " . ($s ? $s : "none") . " >";
ok (my $a = ($tz->isNTPRunning() ? "running" : "not running"), 'isNTPRunning');
diag "isNTPRunning got: < " . $a . " >";
+ SKIP: {
+ #remember to skip the right number of tests
+ skip "To enable dialog tests set TEST_SET_DBUS", 3, unless $ENV{TEST_SET_DBUS};
+ eval {$tz->setLocalRTC(!$h->{UTC})};
+ is ($@, "", 'setLocalRTC' );
+ eval {$tz->setTimeZone($h->{ZONE})};
+ is ($@, "", 'setTimeZone');
+ my $t = localtime;
+ eval {$tz->setTime($t->epoch())};
+ is ($@, "", 'setTime');
+ }
done_testing;