API-ISPManager
view release on metacpan or search on metacpan
Revision history for Perl extension API::ISPManager.
0.01 Mon Dec 15 22:49:15 2008
- original version; created by h2xs 1.23 with options
-X -n API::ISPManager
0.02 Mon Mar 30 23:49:15 2009
- Add examples
0.03 Mon May 21 23:49:15 2009
- Many additions
0.04 Mon Jun 8 03:59:15 2009
- Add VDSManager support
0.05
- Small fixes
0.06
t/02-files.t view on Meta::CPAN
my %connection_params = (
username => $test_user,
password => $test_password,
host => $test_host,
path => 'manager',
);
# Ïîëó÷åíèå ñïèñêà ôàéëîâ
my $file_list_answer = API::ISPManager::file::list( { %connection_params } );
ok($file_list_answer, 'file list');
my @original_file_list = get_file_list('', '');
# Ñîçäàíèå ôàéëà
my $now = time;
my $file_create = API::ISPManager::file::create( {
%connection_params,
filetype => 0,
name => "$now.test",
plid => '',
} );
my @expected_file_list = @original_file_list;
push @expected_file_list, "$now.test";
my @real_file_list = get_file_list('', '');
ok(!union_equal(\@original_file_list, \@real_file_list), 'file creation - check difference exists');
ok(union_equal(\@expected_file_list, \@real_file_list), 'file creation - check created file name');
# Óäàëåíèå ôàéëà
my $file_delete = API::ISPManager::file::delete( {
%connection_params,
elid => "$now.test",
plid => '',
} );
@real_file_list = get_file_list('', '');
ok(union_equal(\@original_file_list, \@real_file_list), 'file delete');
# Êîïèðîâàíèå ôàéëà
$now = time;
API::ISPManager::file::create( {
%connection_params,
filetype => 0,
name => "$now.test",
plid => '',
} );
t/02-files.t view on Meta::CPAN
open my $fh, '>', $now or die "Can't open $now for writing: $!";
print {$fh} 'hello world';
close $fh;
my $upload_result = API::ISPManager::file::upload( {
%connection_params,
plid => '',
file => $now,
} );
@expected_file_list = @original_file_list;
push @expected_file_list, $now;
@real_file_list = get_file_list('', '');
ok(union_equal(\@expected_file_list, \@real_file_list), 'file upload');
API::ISPManager::file::delete( {
%connection_params,
elid => "$now",
plid => '',
} );
t/02-files.t view on Meta::CPAN
plid => '',
file => "$now.tar.gz",
} );
my $extract_result = API::ISPManager::file::extract( {
%connection_params,
plid => '',
elid => "$now.tar.gz",
} );
@expected_file_list = @original_file_list;
push @expected_file_list, $now;
push @expected_file_list, "$now.tar.gz";
@real_file_list = get_file_list('', '');
ok(union_equal(\@expected_file_list, \@real_file_list), 'file extract');
API::ISPManager::file::delete( {
%connection_params,
elid => "$now",
plid => '',
} );
( run in 0.262 second using v1.01-cache-2.11-cpan-f985c23238c )