File: s3-request-object-tags-add.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 (44 lines) | stat: -rw-r--r-- 1,237 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
#!perl

use strict;
use warnings;

use FindBin;

BEGIN { require "$FindBin::Bin/test-helper-s3-request.pl" }
BEGIN { require "$FindBin::Bin/test-helper-tags.pl" }

plan tests => 3;

behaves_like_net_amazon_s3_request 'add some tags to an object' => (
	request_class   => 'Net::Amazon::S3::Operation::Object::Tags::Add::Request',
	with_bucket     => 'some-bucket',
	with_key        => 'some-key',
	with_tags       => fixture_tags_foo_bar_hashref,

	expect_request_method   => 'PUT',
	expect_request_path     => 'some-bucket/some-key?tagging',
	expect_request_header   => {
		content_type => 'application/xml',
	},
	expect_request_content  => fixture_tags_foo_bar_xml,
);

behaves_like_net_amazon_s3_request 'add some tags to an object version' => (
	request_class   => 'Net::Amazon::S3::Operation::Object::Tags::Add::Request',
	with_bucket     => 'some-bucket',
	with_key        => 'some-key',
	with_tags       => fixture_tags_foo_bar_hashref,
	with_version_id => 42,

	expect_request_method   => 'PUT',
	expect_request_path     => 'some-bucket/some-key?tagging&versionId=42',
	expect_request_header   => {
		content_type => 'application/xml',
	},
	expect_request_content  => fixture_tags_foo_bar_xml,
);

had_no_warnings;

done_testing;