File: s3-response-service-buckets-list.t

package info (click to toggle)
libnet-amazon-s3-perl 0.991-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,620 kB
  • sloc: perl: 9,906; makefile: 20
file content (53 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download | duplicates (3)
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
48
49
50
51
52
53
#!perl

use strict;
use warnings;

use FindBin;
use lib $FindBin::Bin;

BEGIN { require "test-helper-s3-response.pl" }

plan tests => 3;

behaves_like_s3_response 'list all my buckets with displayname' => (
	response_class      => 'Net::Amazon::S3::Operation::Buckets::List::Response',

	with_response_fixture ('response::service_list_buckets_with_owner_displayname'),

	expect_success      => 1,
	expect_error        => 0,
	expect_data         => {
		owner_id          => 'bcaf1ffd86f461ca5fb16fd081034f',
		owner_displayname => 'webfile',
		buckets           => [{
			name          => 'quotes',
			creation_data => '2006-02-03T16:45:09.000Z',
		}, {
			name          => 'samples',
			creation_data => '2006-02-03T16:41:58.000Z',
		}],
	},
);

behaves_like_s3_response 'list all my buckets without displayname' => (
	response_class      => 'Net::Amazon::S3::Operation::Buckets::List::Response',

	with_response_fixture ('response::service_list_buckets_without_owner_displayname'),

	expect_success      => 1,
	expect_error        => 0,
	expect_data         => {
		owner_id          => 'bcaf1ffd86f461ca5fb16fd081034f',
		owner_displayname => 'webfile',
		buckets           => [{
			name          => 'quotes',
			creation_data => '2006-02-03T16:45:09.000Z',
		}, {
			name          => 'samples',
			creation_data => '2006-02-03T16:41:58.000Z',
		}],
	},
);

had_no_warnings;