mocks

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICall

type APICall struct {
	Method  string
	Path    string
	Headers map[string]string
	Body    []byte
}

APICall records an API call

type MockAPIServer

type MockAPIServer struct {
	*httptest.Server
	// contains filtered or unexported fields
}

MockAPIServer simulates the DotEnv API

func NewMockAPIServer

func NewMockAPIServer() *MockAPIServer

NewMockAPIServer creates a new mock API server

func (*MockAPIServer) GetCalls

func (m *MockAPIServer) GetCalls() []APICall

func (*MockAPIServer) Reset

func (m *MockAPIServer) Reset()

func (*MockAPIServer) SetOrganizations

func (m *MockAPIServer) SetOrganizations(orgs []dotenv.Organization)

Helper methods to set up test data

func (*MockAPIServer) SetProjects

func (m *MockAPIServer) SetProjects(orgSlug string, projects []dotenv.Project)

func (*MockAPIServer) SetSecrets

func (m *MockAPIServer) SetSecrets(projectSlug string, secrets map[string]string)

func (*MockAPIServer) SimulateError

func (m *MockAPIServer) SimulateError(_ string, _ int, _ string)

SimulateError configures the server to return an error for specific requests. Currently a no-op placeholder; arguments are reserved for the future implementation.

Jump to

Keyboard shortcuts

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