testparity

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Overview

Package testparity builds the shared endpoint-parity stack: real Postgres, a user with a credential, and signed-in sessions. It lives outside pkg/testutils because it imports the module packages — test binaries import it, module code never does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionStack

type SessionStack struct {
	DB        datastore.Store
	Users     *user.PostgresStore
	Passwords *password.Service
	Sessions  *session.Service
}

SessionStack is the wired sign-in surface shared by parity tests.

func NewSessionStack

func NewSessionStack(t *testing.T) *SessionStack

NewSessionStack wires the session surface over the shared test Postgres with migrations applied.

func (*SessionStack) NewUser

func (s *SessionStack) NewUser(t *testing.T, name string) (user.User, string)

NewUser provisions a user with a known credential and returns it plus the plaintext secret.

func (*SessionStack) SignIn

func (s *SessionStack) SignIn(t *testing.T, r http.Handler, username, secret string) string

SignIn submits the sign-in request and returns the session cookie value.

Jump to

Keyboard shortcuts

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