File: vendor-generic.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 (48 lines) | stat: -rw-r--r-- 1,061 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
#!/usr/bin/env perl

use strict;
use warnings;

use FindBin;
use lib $FindBin::Bin;

BEGIN { require "test-helper-common.pl" }

use Net::Amazon::S3;
use Net::Amazon::S3::Vendor::Generic;

plan tests => 3;

my $s3 = Net::Amazon::S3->new (
	vendor => Net::Amazon::S3::Vendor::Generic->new (
		host                 => 'my.service.local',
		use_https            => 1,
		use_virtual_host     => 1,
		authorization_method => 'Net::Amazon::S3::Signature::V4',
		default_region       => 'eu-west-42',
	),
	aws_access_key_id => 'access-key',
	aws_secret_access_key => 'secret-key',
);

it "should provide vendor data via compatible delegations",
	got    => $s3,
	expect => methods (
		host                 => 'my.service.local',
		secure               => bool (1),
		use_virtual_host     => bool (1),
		authorization_method => 'Net::Amazon::S3::Signature::V4',
	),
	;

my $bucket = $s3->bucket ('foo');

it "should return provided region as bucket's region",
	got    => $bucket,
	expect => methods (
		bucket => 'foo',
		region => 'eu-west-42',
	),
	;

had_no_warnings;