Exemple #1
0
func CreateBucket(t btesting.T, bucketTypeId typing.BucketTypeId,
	outBucketId *typing.BucketId) {

	t.Request(btesting.Request{
		Input: btesting.Object{
			"Operation": "CreateBucket",
			"Data": btesting.Object{
				"TypeId": writer.BucketType(bucketTypeId),
			},
		},
		Expecting: btesting.Object{
			"Code": eval.RetcodeOk(),
			"Data": btesting.Object{
				"Id": eval.IsAnyBucketId(outBucketId),
			},
		},
	})
}
Exemple #2
0
func CreateBucketWithMetadata(t btesting.T, bucketTypeId typing.BucketTypeId,
	metadata map[string][]byte,
	outBucketId *typing.BucketId) {
	t.Request(btesting.Request{
		Input: btesting.Object{
			"Operation": "CreateBucket",
			"Data": btesting.Object{
				"TypeId":   writer.BucketType(bucketTypeId),
				"Metadata": writer.Metadata(metadata),
			},
		},
		Expecting: btesting.Object{
			"Code": eval.RetcodeOk(),
			"Data": btesting.Object{
				"Id": eval.IsAnyBucketId(outBucketId),
			},
		},
	})
}