testing

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 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

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 HandleCreateTextObjectSuccessfully

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

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)

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)

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)

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)

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 HandleUpdateObjectSuccessfully

func HandleUpdateObjectSuccessfully(t *testing.T)

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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