accounts

package
v1.8.11 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: GPL-3.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const BridgePassword = "bridgepassword"

BridgePassword is password to be used for IMAP or SMTP under tests.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestAccount

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

func (*TestAccount) Address

func (a *TestAccount) Address() string

func (*TestAccount) AddressID

func (a *TestAccount) AddressID() string

func (*TestAccount) Addresses

func (a *TestAccount) Addresses() *pmapi.AddressList

func (*TestAccount) BridgePassword

func (a *TestAccount) BridgePassword() string

func (*TestAccount) EnsureAddress

func (a *TestAccount) EnsureAddress(addressOrAddressTestID string) string

EnsureAddress accepts address (simply the address) or bddAddressID used in tests (in format [bddAddressID]) and returns always the address. If the address ID cannot be found, the original value is returned.

func (*TestAccount) EnsureAddressID

func (a *TestAccount) EnsureAddressID(addressOrAddressTestID string) string

EnsureAddressID accepts address (simply the address) or bddAddressID used in tests (in format [bddAddressID]) and returns always the real address ID. If the address is not found, the ID of main address is returned.

func (*TestAccount) GetAddress

func (a *TestAccount) GetAddress(addressTestID string) string

func (*TestAccount) GetAddressID

func (a *TestAccount) GetAddressID(addressTestID string) string

func (*TestAccount) IsTwoFAEnabled

func (a *TestAccount) IsTwoFAEnabled() bool

func (*TestAccount) MailboxPassword

func (a *TestAccount) MailboxPassword() []byte

func (*TestAccount) Password

func (a *TestAccount) Password() []byte

func (*TestAccount) User

func (a *TestAccount) User() *pmapi.User

func (*TestAccount) UserID

func (a *TestAccount) UserID() string

func (*TestAccount) Username

func (a *TestAccount) Username() string

type TestAccounts

type TestAccounts struct {
	Users            map[string]*pmapi.User               // Key is user ID used in BDD.
	Addresses        map[string]map[string]*pmapi.Address // Key is real user ID, second key is address ID used in BDD.
	Passwords        map[string]string                    // Key is real user ID.
	MailboxPasswords map[string]string                    // Key is real user ID.
	TwoFAs           map[string]bool                      // Key is real user ID.
}

func Load

func Load(path string) (*TestAccounts, error)

func (*TestAccounts) GetTestAccount

func (a *TestAccounts) GetTestAccount(username string) *TestAccount

func (*TestAccounts) GetTestAccountWithAddress

func (a *TestAccounts) GetTestAccountWithAddress(username, bddAddressID string) *TestAccount

GetTestAccountWithAddress returns the test account with the given username configured to use the given bddAddressID.

Jump to

Keyboard shortcuts

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