testutil

package
v0.7.13 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const IntegrationEnv = "OPENSERP_INTEGRATION_TESTS"
View Source
const IntegrationHeadfulEnv = "OPENSERP_INTEGRATION_HEADFUL"
View Source
const IntegrationStrictEnv = "OPENSERP_INTEGRATION_STRICT"

Variables

This section is empty.

Functions

func AssertFirstResultFilled added in v0.7.2

func AssertFirstResultFilled(t *testing.T, results any)

AssertFirstResultFilled checks that the first result has non-empty URL, Title, and Description. Accepts any slice of structs with those string fields (avoids core import cycle).

func AssertSequentialRanks added in v0.7.2

func AssertSequentialRanks(t *testing.T, results any)

AssertSequentialRanks verifies that result ranks start at 1 and increase by 1. Accepts any slice of structs with an int Rank field (avoids core import cycle).

func IntegrationHeadful added in v0.7.2

func IntegrationHeadful() bool

func IntegrationStrict added in v0.7.2

func IntegrationStrict() bool

func RequireEnv

func RequireEnv(t *testing.T, key string) string

func RequireIntegration

func RequireIntegration(t *testing.T)

func ResponseFromBytes added in v0.7.2

func ResponseFromBytes(data []byte) *http.Response

ResponseFromBytes wraps raw bytes in an *http.Response with status 200.

func ResponseFromFixture added in v0.7.2

func ResponseFromFixture(t *testing.T, file string) *http.Response

ResponseFromFixture reads an HTML file from the package's testdata/ directory and returns it wrapped in an *http.Response suitable for parser functions.

func ResponseFromString added in v0.7.2

func ResponseFromString(html string) *http.Response

ResponseFromString wraps a raw HTML string in an *http.Response.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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