Permalink
Browse files

Basic test for Collect::Pageanalyze

  • Loading branch information...
1 parent 3b6609a commit 8f4995acf84a52886b93106a82b8a834b0517222 @cdybedahl cdybedahl committed Jun 11, 2012
Showing with 33 additions and 1 deletion.
  1. +9 −0 Zonestat/t/bin/pageanalyze_mock.pl
  2. +19 −0 Zonestat/t/collect-pageanalyze.t
  3. +5 −1 Zonestat/t/config/Config.yaml

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,19 @@
+use Test::More;
+use lib 't/lib';
+
+BEGIN{
+ use_ok('Zonestat');
+ use_ok('Zonestat::Collect::Pageanalyze');
+}
+
+my $zs = new_ok(Zonestat => ['t/config/Config']);
+
+my ($name, $data) = Zonestat::Collect::Pageanalyze->collect('iis.se', $zs);
+
+is($name, 'pageanalyze');
+ok($data->{http} and $data->{http}{summary});
+ok($data->{https} and $data->{https}{summary});
+is($data->{http}{summary}{total_bytes}, 909228);
+is($data->{https}{summary}{total_bytes}, 909228);
+
+done_testing;
@@ -11,4 +11,8 @@ couchdb:
dbprefix: "zstat"
daemon:
- geoip: "t/config/GeoLiteCity.dat"
+ geoip: "t/config/GeoLiteCity.dat"
+
+zonestat:
+ python: "t/bin/pageanalyze_mock.pl"
+ pageanalyzer: "/tmp"

0 comments on commit 8f4995a

Please sign in to comment.