helpers

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncludeRandomRangeTests

func IncludeRandomRangeTests(t *testing.T, baseTest test.SugarTest, fullData []byte, contentType string) test.SugarTests

IncludeRandomRangeTests takes a test where there is no "Range" header set in the request, or checks on the StatusCode, Body, or Content-Range headers and verifies whether a valid response is given for the requested ranges. Will test the full request, a single range request for the first passed range as well as a multi-range request for all the requested ranges.

If contentType is empty it is ignored.

If no ranges are passed then some non-overlapping ranges are automatically generated for data >= 10 bytes. Smaller data will produce a panic to avoid undefined behavior.

Note: HTTP Range requests can be validly responded with either the full data, or the requested partial data Note: HTTP Multi Range requests can be validly responded with one of the full data, the partial data from the first range, or the partial data from all the requested ranges

func IncludeRangeTests

func IncludeRangeTests(t *testing.T, baseTest test.SugarTest, byteRanges []string, fullData []byte, contentType string) test.SugarTests

IncludeRangeTests takes a test where there is no "Range" header set in the request, or checks on the StatusCode, Body, or Content-Range headers and verifies whether a valid response is given for the requested ranges. Will test the full request, a single range request for the first passed range as well as a multi-range request for all the requested ranges.

If contentType is empty it is ignored.

If no ranges are passed, then a panic is produced.

Note: HTTP Range requests can be validly responded with either the full data, or the requested partial data Note: HTTP Multi Range requests can be validly responded with one of the full data, the partial data from the first range, or the partial data from all the requested ranges

func MultiRangeTestTransform

func MultiRangeTestTransform(t *testing.T, baseTest test.SugarTest, byteRanges []string, fullData []byte, contentType string) test.SugarTest

MultiRangeTestTransform takes a test where there is no "Range" header set in the request, or checks on the StatusCode, Body, or Content-Range or Content-Type headers and verifies whether a valid response is given for the requested ranges.

If contentType is empty it is ignored.

Note: HTTP Multi Range requests can be validly responded with one of the full data, the partial data from the first range, or the partial data from all the requested ranges.

func OnlyRandomRangeTests

func OnlyRandomRangeTests(t *testing.T, baseTest test.SugarTest, fullData []byte, contentType string) test.SugarTests

OnlyRandomRangeTests takes a test where there is no "Range" header set in the request, or checks on the StatusCode, Body, or Content-Range headers and verifies whether a valid response is given for the requested ranges. Will test both a single range request for the first passed range as well as a multi-range request for all the requested ranges.

If contentType is empty it is ignored.

If no ranges are passed then some non-overlapping ranges are automatically generated for data >= 10 bytes. Smaller data will produce a panic to avoid undefined behavior.

Note: HTTP Range requests can be validly responded with either the full data, or the requested partial data Note: HTTP Multi Range requests can be validly responded with one of the full data, the partial data from the first range, or the partial data from all the requested ranges

func OnlyRangeTests

func OnlyRangeTests(t *testing.T, baseTest test.SugarTest, byteRanges []string, fullData []byte, contentType string) test.SugarTests

OnlyRangeTests takes a test where there is no "Range" header set in the request, or checks on the StatusCode, Body, or Content-Range headers and verifies whether a valid response is given for the requested ranges. Will test both a single range request for the first passed range as well as a multi-range request for all the requested ranges.

If contentType is empty it is ignored.

If no ranges are passed, then a panic is produced.

Note: HTTP Range requests can be validly responded with either the full data, or the requested partial data Note: HTTP Multi Range requests can be validly responded with one of the full data, the partial data from the first range, or the partial data from all the requested ranges

func SingleRangeTestTransform

func SingleRangeTestTransform(t *testing.T, baseTest test.SugarTest, byteRange string, fullData []byte) test.SugarTest

SingleRangeTestTransform takes a test where there is no "Range" header set in the request, or checks on the StatusCode, Body, or Content-Range headers and verifies whether a valid response is given for the requested range.

Note: HTTP Range requests can be validly responded with either the full data, or the requested partial data.

func StandardCARTestTransforms

func StandardCARTestTransforms(t *testing.T, sts test.SugarTests) test.SugarTests

func UnwrapSubdomainTests

func UnwrapSubdomainTests(t *testing.T, tests test.SugarTests) test.SugarTests

*

  • UnwrapSubdomainTests takes a list of tests and returns a (larger) list of tests
  • that will run on the subdomain gateway.

Types

This section is empty.

Jump to

Keyboard shortcuts

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