hydra/tests/query-all-tables.pl

22 lines
486 B
Perl
Raw Normal View History

2011-03-16 08:50:31 +00:00
use strict;
use Hydra::Schema;
use Hydra::Helper::Nix;
my $db = openHydraDB;
my @sources = $db->sources;
my $nrtables = scalar(@sources);
2011-03-16 11:26:14 +00:00
use Test::Simple tests => 43;
2011-03-16 08:50:31 +00:00
foreach my $source (@sources) {
my $title = "Basic select query for $source";
2011-03-16 08:50:31 +00:00
if( $source !~ m/^(LatestSucceeded|JobStatus|ActiveJobs)/) {
ok(scalar($db->resultset($source)->all) == 0, $title);
}
else {
ok(scalar($db->resultset($source)->search({},{ bind => ["", "", ""] })) == 0, $title);
2011-03-16 08:50:31 +00:00
}
}