integration

package
v0.0.0-...-c5339c6 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserName = "test"
	Password = "test"
	Email    = "test@mobius8.io"
	GOHABITS = "go-habits"
)

Typical user stub data

Variables

View Source
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

func GetAPIToken(serverURI, username, password string) (token, id string)

GetAPIToken returns habitica api token and id

func GetUserConfigPath

func GetUserConfigPath() string

GetUserConfigPath returns the default path for a users config file.

func GoHabits

func GoHabits(args ...string) *gexec.Session

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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