fixtures

package
v0.0.1-beta.11 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangePosbusAutoAttribute

func ChangePosbusAutoAttribute(t *testing.T, node universe.Node, world universe.World, userId *umid.UMID)

Change an attribute to trigger the backend to send a update message.

func ChangeRenderAutoAttribute

func ChangeRenderAutoAttribute(t *testing.T, node universe.Node, world universe.World)

func ContainerController

func ContainerController(t *testing.T, networkName string, config config.Postgres) testcontainers.Container

Run the controller as a container.

func ContainerMediaManager

func ContainerMediaManager(t *testing.T, networkName string) (testcontainers.Container, *url.URL)

Run the Media manager as a container.

func ContainerNetwork

func ContainerNetwork(t *testing.T, name string)

Create a (docker) network to put multiple containers into.

func ContainerPostgres

func ContainerPostgres(t *testing.T, networkName string) (testcontainers.Container, config.Postgres)

Startup a postgresql database.

func Controller

func Controller(t *testing.T, pgConfig config.Postgres, mmURL *url.URL) (*url.URL, universe.Node)

Run the controller in a goroutine.

func GetFakeUser

func GetFakeUser() universe.User

func GuestAccount

func GuestAccount(ctURL *url.URL) (*umid.UMID, string, error)

Create a guest account in the backend through the API. Returns the guest user ID and authentication token (JWT). For use in integration tests.

func Object

func Object(t *testing.T, node universe.Node, w universe.World, name string) universe.Object

func UserBlueprint

func UserBlueprint(i int, last entry.User) entry.User

fixtory blueprint for users

func World

func World(t *testing.T, node universe.Node, creator *entry.User, name string) universe.World

Create a minimal world.

Types

type FakeUser

type FakeUser struct {
	universe.User
	// contains filtered or unexported fields
}

Fake user for test fixtures. Minimal implementation of universe.User interface TODO: move to 'fakes' package(?)

func (*FakeUser) AddInfluxTags

func (m *FakeUser) AddInfluxTags(
	prefix string, point *influxWrite.Point) *influxWrite.Point

func (*FakeUser) GetID

func (m *FakeUser) GetID() umid.UMID

func (*FakeUser) GetLastPosTime

func (m *FakeUser) GetLastPosTime() int64

func (*FakeUser) GetLastSendPosTime

func (m *FakeUser) GetLastSendPosTime() int64

func (*FakeUser) GetTransform

func (m *FakeUser) GetTransform() *cmath.TransformNoScale

func (*FakeUser) GetUserDefinition

func (m *FakeUser) GetUserDefinition() *posbus.UserData

func (*FakeUser) GetWorld

func (m *FakeUser) GetWorld() universe.World

func (*FakeUser) LockSendBuffer

func (m *FakeUser) LockSendBuffer()

func (*FakeUser) ReleaseSendBuffer

func (m *FakeUser) ReleaseSendBuffer()

func (*FakeUser) Send

func (m *FakeUser) Send(message *websocket.PreparedMessage) error

func (*FakeUser) SendDirectly

func (m *FakeUser) SendDirectly(message *websocket.PreparedMessage) error

func (*FakeUser) SetLastSendPosTime

func (m *FakeUser) SetLastSendPosTime(i int64)

func (*FakeUser) SetObject

func (m *FakeUser) SetObject(o universe.Object)

func (*FakeUser) SetTransform

func (m *FakeUser) SetTransform(t cmath.TransformNoScale)

func (*FakeUser) SetWorld

func (m *FakeUser) SetWorld(w universe.World)

Jump to

Keyboard shortcuts

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