testing

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

objects unit tests

Index

Constants

This section is empty.

Variables

View Source
var ExpectedListInfo = []objects.Object{
	{
		Hash:         "451e372e48e0f6b1114fa0724aa79fa1",
		LastModified: time.Date(2016, time.August, 17, 22, 11, 58, 602650000, time.UTC),
		Bytes:        14,
		Name:         "goodbye",
		ContentType:  "application/octet-stream",
	},
	{
		Hash:         "451e372e48e0f6b1114fa0724aa79fa1",
		LastModified: time.Date(2016, time.August, 17, 22, 11, 58, 602650000, time.UTC),
		Bytes:        14,
		Name:         "hello",
		ContentType:  "application/octet-stream",
	},
}

ExpectedListInfo is the result expected from a call to `List` when full info is requested.

View Source
var ExpectedListNames = []string{"hello", "goodbye"}

ExpectedListNames is the result expected from a call to `List` when just object names are requested.

View Source
var ExpectedListSubdir = []objects.Object{
	{
		Subdir: "directory/",
	},
}

ExpectedListSubdir is the result expected from a call to `List` when full info is requested.

Functions

func HandleBulkDeleteSuccessfully added in v0.11.0

func HandleBulkDeleteSuccessfully(t *testing.T)

HandleBulkDeleteSuccessfully creates an HTTP handler at `/` on the test handler mux that responds with a `BulkDelete` response.

func HandleCopyObjectSuccessfully

func HandleCopyObjectSuccessfully(t *testing.T)

HandleCopyObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that responds with a `Copy` response.

func HandleCopyObjectVersionSuccessfully added in v1.3.0

func HandleCopyObjectVersionSuccessfully(t *testing.T)

HandleCopyObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that responds with a `Copy` response.

func HandleCreateTextObjectSuccessfully

func HandleCreateTextObjectSuccessfully(t *testing.T, content string, options ...option)

HandleCreateTextObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that responds with a `Create` response. A Content-Type of "text/plain" is expected.

func HandleCreateTextWithCacheControlSuccessfully

func HandleCreateTextWithCacheControlSuccessfully(t *testing.T, content string)

HandleCreateTextWithCacheControlSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that responds with a `Create` response. A Cache-Control of `max-age="3600", public` is expected.

func HandleCreateTypelessObjectSuccessfully

func HandleCreateTypelessObjectSuccessfully(t *testing.T, content string)

HandleCreateTypelessObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that responds with a `Create` response. No Content-Type header may be present in the request, so that server- side content-type detection will be triggered properly.

func HandleDeleteObjectSuccessfully

func HandleDeleteObjectSuccessfully(t *testing.T, options ...option)

HandleDeleteObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that responds with a `Delete` response.

func HandleDownloadObjectSuccessfully

func HandleDownloadObjectSuccessfully(t *testing.T, options ...option)

HandleDownloadObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that responds with a `Download` response.

func HandleGetObjectSuccessfully

func HandleGetObjectSuccessfully(t *testing.T, options ...option)

HandleGetObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that responds with a `Get` response.

func HandleListObjectNamesSuccessfully

func HandleListObjectNamesSuccessfully(t *testing.T)

HandleListObjectNamesSuccessfully creates an HTTP handler at `/testContainer` on the test handler mux that responds with a `List` response when only object names are requested.

func HandleListObjectsInfoSuccessfully

func HandleListObjectsInfoSuccessfully(t *testing.T, options ...option)

HandleListObjectsInfoSuccessfully creates an HTTP handler at `/testContainer` on the test handler mux that responds with a `List` response when full info is requested.

func HandleListSubdirSuccessfully

func HandleListSubdirSuccessfully(t *testing.T)

HandleListSubdirSuccessfully creates an HTTP handler at `/testContainer` on the test handler mux that responds with a `List` response when full info is requested.

func HandleListZeroObjectNames204 added in v1.1.0

func HandleListZeroObjectNames204(t *testing.T)

HandleListZeroObjectNames204 creates an HTTP handler at `/testContainer` on the test handler mux that responds with "204 No Content" when object names are requested. This happens on some, but not all, objectstorage instances. This case is peculiar in that the server sends no `content-type` header.

func HandleUpdateObjectSuccessfully

func HandleUpdateObjectSuccessfully(t *testing.T, options ...option)

HandleUpdateObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that responds with a `Update` response.

func WithPath added in v1.3.0

func WithPath(s string) option

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL