ascodetest

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ascodetest is an in-memory Watchtower project API for the as-code tests: it follows the REST shapes of the kinds table (list pages, POST create, PUT/PATCH/DELETE by id or name).

Index

Constants

View Source
const Org = "org_test"

Org is the org id the fake serves for the org-scoped kinds.

View Source
const Project = "prj_test"

Project is the project id the fake serves.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*httptest.Server

	Calls []string
	// Secrets are the check-secret values the API received.
	Secrets []string
	// contains filtered or unexported fields
}

Server is the fake; Calls records "METHOD path" lines.

func New

func New(t testing.TB) *Server

New starts the fake and stops it with the test.

func (*Server) Body

func (s *Server) Body(kind, name string) map[string]any

Body returns a copy of one stored object by its name.

func (*Server) Count

func (s *Server) Count(kind string) int

Count returns how many stored objects of kind exist.

func (*Server) Writes

func (s *Server) Writes() (n int)

Writes counts the mutating calls so far.

Jump to

Keyboard shortcuts

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