athenatest

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDockerService

func GetDockerService[T any](
	t *testing.T,
	context DockerServiceConfig[T],
) T

func TestRequest

func TestRequest(t *testing.T, app *athena.App, testCase HTTPTestCase)

Types

type DockerServiceConfig

type DockerServiceConfig[T any] struct {
	DockerImage    string
	DockerImageTag string
	InternalPort   int
	Environment    map[string]string
	Builder        func(host string, port int) (T, error)
}

func (DockerServiceConfig[T]) Env

func (d DockerServiceConfig[T]) Env() []string

type HTTPTestCase

type HTTPTestCase struct {
	Request  HTTPTestCaseRequest
	Expected HTTPTestCaseResponse
}

type HTTPTestCaseRequest

type HTTPTestCaseRequest struct {
	Method   string
	Path     string
	Query    url.Values
	Body     any
	Headers  http.Header
	Modifier func(request *http.Request)
}

func (HTTPTestCaseRequest) BuildRequest

func (testCase HTTPTestCaseRequest) BuildRequest(t *testing.T) *http.Request

type HTTPTestCaseResponse

type HTTPTestCaseResponse struct {
	Status  int
	Headers http.Header
	Body    any
}

Jump to

Keyboard shortcuts

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