Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteUser(serverURI, username, password, feedback string)
- func EventuallyLogin(session *gexec.Session, in io.WriteCloser, username, password string)
- func ExpectSuccessfulLogin(user, password string)
- func GetAPIToken(serverURI, username, password string) (token, id string)
- func GetUserConfigPath() string
- func GoHabits(args ...string) *gexec.Session
- func GoHabitsWithStdin(args ...string) (*gexec.Session, io.WriteCloser)
- func RegisterUser(serverURI, username, password, email string)
- func RemoveConfigFile()
- func ResetUser()
- func SaveAPIToken(serverURI, username, password string)
- func TouchConfigFile() string
Constants ¶
const ( UserName = "test" Password = "test" Email = "test@mobius8.io" GOHABITS = "go-habits" )
Typical user stub data
Variables ¶
var ( HabiticaAPIURI string BuildVersion string APIClient *api.HabiticaAPI APIToken string APIID string )
Global variables for all integration tests
Functions ¶
func DeleteUser ¶
func DeleteUser(serverURI, username, password, feedback string)
DeleteUser removes a user from habitica using api
func EventuallyLogin ¶
func EventuallyLogin(session *gexec.Session, in io.WriteCloser, username, password string)
EventuallyLogin takes an existing session, waits to be prompted username and pasword, and writes the username and password to stdin.
func ExpectSuccessfulLogin ¶
func ExpectSuccessfulLogin(user, password string)
ExpectSuccessfulLogin will run the login command and ultimately update the config file used.
func GetAPIToken ¶
GetAPIToken returns habitica api token and id
func GetUserConfigPath ¶
func GetUserConfigPath() string
GetUserConfigPath returns the default path for a users config file.
func GoHabits ¶
GoHabits builds session for invoking commands go-habits. The go-habits binary must be install in PATH.
func GoHabitsWithStdin ¶
func GoHabitsWithStdin(args ...string) (*gexec.Session, io.WriteCloser)
GoHabitsWithStdin builds session and stdin writer for invoking commands go-habits. go-habits must be install in PATH
func RegisterUser ¶
func RegisterUser(serverURI, username, password, email string)
RegisterUser uses habitica api to register a new user
func RemoveConfigFile ¶
func RemoveConfigFile()
RemoveConfigFile tries to remove the User's config file. It returns safely of the file doesn't exist.
func ResetUser ¶
func ResetUser()
ResetUser leaves auth and api token but removes all data from their account.
func SaveAPIToken ¶
func SaveAPIToken(serverURI, username, password string)
SaveAPIToken saves habitica api token and id to integration package variables
func TouchConfigFile ¶
func TouchConfigFile() string
TouchConfigFile gets the User's config file path and writes a new line to it.
Types ¶
This section is empty.