test torrent_list and display test names
[cloudstore.git] / t / Gearman.t
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4
5 use Test::More tests => 5;
6 use Data::Dump qw(dump);
7
8 use lib 'lib';
9
10 use_ok 'CloudStore::Gearman';
11
12 my $hostname = `hostname -s`;
13 chomp $hostname;
14
15 my $user = $ARGV[0] || 2001;
16
17 ok my $o = CloudStore::Gearman->gearman_do( $hostname . '_s1_quota_get' => $user ), 'quota_get';
18 diag dump $o;
19 cmp_ok $o, '=~', qr/^(\d+)\s+(\d+)$/, 'format: used quota';
20
21 ok $o = CloudStore::Gearman->gearman_do( 'user_usage' => $user ), 'user_usage';
22 diag dump $o;
23
24 ok $o = CloudStore::Gearman->gearman_do( $hostname . '_s1_torrent_list' ), 'torrent_list';
25 diag dump $o;