-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path05-events.t
48 lines (37 loc) · 937 Bytes
/
05-events.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/lib";
use Opsview::REST::TestUtils;
use Test::More;
use Test::Exception;
my @tests = (
{
args => [ ],
url => '/event',
},
{
args => [ host => 'hostA' ],
url => '/event?host=hostA',
},
{
args => [ host => [qw/ hostA hostB /] ],
url => '/event?host=hostA&host=hostB',
},
{
args => [
host => [qw/ hostA hostB /],
keyword => [qw/ abcde efghi /],
],
url => '/event?keyword=abcde&keyword=efghi&host=hostA&host=hostB',
},
);
plan tests => scalar @tests + 2;
require_ok 'Opsview::REST::Event';
test_urls('Opsview::REST::Event', @tests);
SKIP: {
skip 'No $ENV{OPSVIEW_REST_TEST} defined', 1
if (not defined $ENV{OPSVIEW_REST_TEST});
my $ops = get_opsview();
lives_ok { $ops->events } "Call to 'events' didn't die";
};