testsupport4datatug

package
v0.60.5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 25 Imported by: ? 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 testsupport4datatug builds the stored state a host test needs to exercise DataTug's protected-project role guard end to end. Hosts import it from tests only: it takes a testing.TB, it never talks to a network, and it creates the project through the same shared-project service a host serves, so a host does not have to import the DataTug domain packages to seed it.

Index

Constants

View Source
const (
	SpaceID         = "protected_project_space"
	OwnerUID        = "protected_project_owner"
	MemberUID       = "protected_project_member"
	TargetUID       = "protected_project_target"
	OwnerContactID  = "owner_contact"
	MemberContactID = "member_contact"
	TargetContactID = "target_contact"
)

Identifiers of the stored fixture.

Variables

This section is empty.

Functions

func ContactItemRef

func ContactItemRef(contactID string) coretypes.ItemRef

ContactItemRef is the linkage item of a fixture contact.

Types

type ProtectedProject

type ProtectedProject struct {
	DB        dal.DB
	ProjectID string
	// Business is the trusted native Business reader to hand to
	// host4datatug.ProjectRelationshipMutationPolicies.
	Business facade4datatug.BusinessSharedProjectOptions
}

ProtectedProject is a Business-admitted protected DataTug project stored in an in-memory database. The Space has three members, each with an active contact: the project owner (who holds the project's owner role, the only one that may manage assignments), a second member and a third member. Only the owner is linked to the project.

func NewProtectedProject

func NewProtectedProject(t testing.TB) *ProtectedProject

NewProtectedProject stores the Space, its three contacts and a Business project created by the owner. It sets the reviewed plan settings through t.Setenv, so the test must not be parallel.

func (*ProtectedProject) ProjectItemRef

func (p *ProtectedProject) ProjectItemRef() coretypes.ItemRef

ProjectItemRef is the stored project's linkage item.

Jump to

Keyboard shortcuts

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