added ping store and refactored common code
[APKPM.git] / t / Store.t
index c06642e..465e7de 100755 (executable)
--- a/t/Store.t
+++ b/t/Store.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 3;
+use Test::More tests => 4;
 use Data::Dump qw(dump);
 
 use lib 'lib';
@@ -14,16 +14,24 @@ ok my $o = APKPM::Store->new, 'new';
 ok my $r = $o->ADSL('job',{
 ip => '127.0.0.1',
 username => 'nobody',
-ATTNRX => "36.5",
-ATTNTX => "17.8",
-MAXRX  => 13500,
-MAXTX  => 880,
-PWRRX  => "0.0",
-PWRTX  => "12.6",
-RX     => 8500,
-SNRRX  => "11.4",
-SNRTX  => "16.0",
-TX     => 798,
+ADSL => {
+       ATTNRX => "36.5",
+       ATTNTX => "17.8",
+       MAXRX  => 13500,
+       MAXTX  => 880,
+       PWRRX  => "0.0",
+       PWRTX  => "12.6",
+       RX     => 8500,
+       SNRRX  => "11.4",
+       SNRTX  => "16.0",
+       TX     => 798,
+}
 }), 'ADSL';
+diag dump($r);
 
+ok my $r = $o->ping('job',{
+ip => '127.0.0.1',
+username => 'nobody',
+rtt => 0.042,
+}), 'ping';
 diag dump($r);