use strict;
use warnings;
-use Test::More tests => 4;
+use Test::More tests => 15;
use Data::Dump qw(dump);
use lib 'lib';
my $user = $ARGV[0] || 2001;
-ok my $o = CloudStore::Gearman->gearman_do( $hostname . '_s1_quota_get' => $user );
+sub gearman {
+ my ( $function, $args ) = @_;
+ ok my $o = CloudStore::Gearman->gearman_do( @_ ), $_[0];
+ diag dump $o;
+ return $o;
+}
+
+my $o = gearman $hostname . '_s1_quota_get' => $user;
diag dump $o;
cmp_ok $o, '=~', qr/^(\d+)\s+(\d+)$/, 'format: used quota';
-ok $o = CloudStore::Gearman->gearman_do( 'user_usage' => $user );
-diag dump $o;
+gearman( 'user_usage' => $user );
+
+gearman( $hostname . '_s1_torrent_list' );
+
+
+gearman send_file => '~u2001/foo.txt#~u2002/dir with space/file with space';
+
+gearman delete => '~u2002/dir with space/file with space';
+
+gearman send_file => '~u2001/foo.txt#~u2002/foo.txt';
+
+gearman rename_file => '~u2002/foo.txt#bar.txt';
+gearman rename_file => '~u2002/bar.txt#baz.txt';
+
+cmp_ok
+gearman( file_size => '~u2001/foo.txt' ), '==',
+gearman( file_size => '~u2002/baz.txt' ), 'size_same';
+
+gearman delete => '~u2002/baz.txt';
+
+ok ! CloudStore::Gearman->gearman_do( file_size => '~u2002/baz.txt' ), 'deleted file size';
+