testing

package
v0.0.0-...-efe2ce5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0, MIT Imports: 41 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFakeRepo

func GenerateFakeRepo(r *repo.Repo, size int) (cid.Cid, error)

func MakeRandomPost

func MakeRandomPost() string

func RandAction

func RandAction() string

func RandFakeAtUri

func RandFakeAtUri(collection, rkey string) string

func RandFakeCid

func RandFakeCid() cid.Cid

func RandSentence

func RandSentence(words []string, maxl int) string

func ReadWords

func ReadWords() ([]string, error)

func TestPLC

func TestPLC(t *testing.T) *plc.FakeDid

Types

type EventStream

type EventStream struct {
	Lk     sync.Mutex
	Events []*events.XRPCStreamEvent
	Cancel func()

	Cur int
}

func (*EventStream) All

func (es *EventStream) All() []*events.XRPCStreamEvent

func (*EventStream) Next

func (es *EventStream) Next() *events.XRPCStreamEvent

func (*EventStream) WaitFor

func (es *EventStream) WaitFor(n int) []*events.XRPCStreamEvent

type TestPDS

type TestPDS struct {
	// contains filtered or unexported fields
}

func MustSetupPDS

func MustSetupPDS(t *testing.T, suffix string, plc plc.PLCClient) *TestPDS

func SetupPDS

func SetupPDS(ctx context.Context, suffix string, plc plc.PLCClient) (*TestPDS, error)

func (*TestPDS) BumpLimits

func (tp *TestPDS) BumpLimits(t *testing.T, b *TestRelay)

func (*TestPDS) Cleanup

func (tp *TestPDS) Cleanup()

func (*TestPDS) HTTPHost

func (tp *TestPDS) HTTPHost() string

HTTPHost returns a URL string that the PDS server is running at with the scheme set for HTTP

func (*TestPDS) MustNewUser

func (tp *TestPDS) MustNewUser(t *testing.T, handle string) *TestUser

func (*TestPDS) NewUser

func (tp *TestPDS) NewUser(handle string) (*TestUser, error)

func (*TestPDS) RawHost

func (tp *TestPDS) RawHost() string

HTTPHost returns a host:port string that the PDS server is running at

func (*TestPDS) RequestScraping

func (tp *TestPDS) RequestScraping(t *testing.T, b *TestRelay)

func (*TestPDS) Run

func (tp *TestPDS) Run(t *testing.T)

type TestRelay

type TestRelay struct {
	// contains filtered or unexported fields
}

func MustSetupRelay

func MustSetupRelay(t *testing.T, didr plc.PLCClient) *TestRelay

func SetupRelay

func SetupRelay(ctx context.Context, didr plc.PLCClient) (*TestRelay, error)

func (*TestRelay) BanDomain

func (b *TestRelay) BanDomain(t *testing.T, d string)

func (*TestRelay) Events

func (b *TestRelay) Events(t *testing.T, since int64) *EventStream

func (*TestRelay) Host

func (t *TestRelay) Host() string

func (*TestRelay) Run

func (b *TestRelay) Run(t *testing.T)

type TestUser

type TestUser struct {
	// contains filtered or unexported fields
}

func (*TestUser) ChangeHandle

func (u *TestUser) ChangeHandle(t *testing.T, nhandle string)

func (*TestUser) DID

func (u *TestUser) DID() string

func (*TestUser) Follow

func (u *TestUser) Follow(t *testing.T, did string) string

func (*TestUser) GetFeed

func (u *TestUser) GetFeed(t *testing.T) []*bsky.FeedDefs_FeedViewPost

func (*TestUser) GetNotifs

func (*TestUser) Like

func (u *TestUser) Like(t *testing.T, post *atproto.RepoStrongRef)

func (*TestUser) Post

func (u *TestUser) Post(t *testing.T, body string) *atproto.RepoStrongRef

func (*TestUser) Reply

func (u *TestUser) Reply(t *testing.T, replyto, root *atproto.RepoStrongRef, body string) string

Jump to

Keyboard shortcuts

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