test

package
v0.17.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversationFactory

type ConversationFactory struct {

	// TestStart is the timestamp used as a base for timestamps and ULIDs in any given test.
	TestStart time.Time
	// contains filtered or unexported fields
}

ConversationFactory can be embedded or included by test suites that want to generate statuses and conversations.

func (*ConversationFactory) NewTestConversation

func (f *ConversationFactory) NewTestConversation(localAccount *gtsmodel.Account, nowOffset time.Duration) *gtsmodel.Conversation

NewTestConversation creates a new status and adds it to a new unread conversation, returning the conversation.

func (*ConversationFactory) NewTestStatus

func (f *ConversationFactory) NewTestStatus(localAccount *gtsmodel.Account, threadID string, nowOffset time.Duration, inReplyToStatus *gtsmodel.Status) *gtsmodel.Status

func (*ConversationFactory) NewULID

func (f *ConversationFactory) NewULID(offset time.Duration) string

NewULID is a version of id.NewULID that uses the test start time and an offset instead of the real time.

func (*ConversationFactory) SetLastStatus

func (f *ConversationFactory) SetLastStatus(conversation *gtsmodel.Conversation, status *gtsmodel.Status) *gtsmodel.Conversation

SetLastStatus sets an already stored status as the last status of a new or already stored conversation, and returns the updated conversation.

func (*ConversationFactory) SetupSuite

func (f *ConversationFactory) SetupSuite(suite testSuite)

SetupSuite should be called by the SetupSuite of test suites that use this mixin.

func (*ConversationFactory) SetupTest

func (f *ConversationFactory) SetupTest(db db.DB)

SetupTest should be called by the SetupTest of test suites that use this mixin.

Jump to

Keyboard shortcuts

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