test

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AccessKey      = os.Getenv("accessKey")
	SecretKey      = os.Getenv("secretKey")
	Bucket         = testBucket()
	BucketDomain   = testBucketDomain()
	UploadDomain   = testUploadDomain()
	DocumentOption = "--doc"
)
View Source
var (
	BucketNotExist      = "qshell-na0-mock"
	BucketObjectDomain  = fmt.Sprintf("http://%s/hello1_test.json", BucketDomain)
	BucketObjectDomains = []string{
		fmt.Sprintf("http://%s/hello1_test.json", BucketDomain),
		fmt.Sprintf("http://%s/hello2_test.json", BucketDomain),
		fmt.Sprintf("http://%s/hello3_test.json", BucketDomain),
		fmt.Sprintf("http://%s/hello4_test.json", BucketDomain),
		fmt.Sprintf("http://%s/hello5_test.json", BucketDomain),
		fmt.Sprintf("http://%s/hello6_test.json", BucketDomain),
		fmt.Sprintf("http://%s/hello7_test.json", BucketDomain),
	}
	BucketObjectDomainsString = strings.ReplaceAll(`http://domain/hello1_test.json
http://domain/hello2_test.json
http://domain/hello3_test.json
http://domain/hello4_test.json
http://domain/hello5_test.json
http://domain/hello6_test.json
http://domain/hello7_test.json
`, "domain", BucketDomain)

	Key         = "hello1_test.json"
	ImageKey    = "image.png"
	KeyNotExist = "hello_mock_mock.json"
	OriginKeys  = []string{"hello1.json", "hello2.json", "hello3.json", "hello4.json", "hello5.json", "hello6.json", "hello7.json"}
	Keys        = []string{"hello1_test.json", "hello2_test.json", "hello3_test.json", "hello4_test.json", "hello5_test.json", "hello6_test.json", "hello7_test.json"}
	KeysString  = `hello1_test.json
hello2_test.json
hello3_test.json
hello4_test.json
hello5_test.json
hello6_test.json
hello7_test.json`
)

Functions

func AppendToFile

func AppendToFile(path string, content string) error

func CreateFileWithContent

func CreateFileWithContent(fileName, content string) (string, error)

func CreateTempFile

func CreateTempFile(size int) (string, error)

func DefaultTestErrorHandler

func DefaultTestErrorHandler(t *testing.T) func(line string)

func ExistDir

func ExistDir(path string) (bool, error)

func ExistFile

func ExistFile(path string) (bool, error)

func FileContent

func FileContent(path string) string

func FileCountInDir

func FileCountInDir(path string) int

func IsDebug added in v2.9.1

func IsDebug() bool

func IsFileHasContent

func IsFileHasContent(path string) bool

func NewTestFlow

func NewTestFlow(args ...string) *testFlow

func RemoveFile

func RemoveFile(filePath string) error

func RemoveResultPath added in v2.8.0

func RemoveResultPath() error

func RemoveRootPath added in v2.8.0

func RemoveRootPath() error

func RemoveTempPath added in v2.8.0

func RemoveTempPath() error

func ResultPath

func ResultPath() (string, error)

func RootPath

func RootPath() (string, error)

func RunCmd

func RunCmd(t *testing.T, args ...string) string

func RunCmdWithError

func RunCmdWithError(args ...string) (string, string)

func TempPath

func TempPath() (string, error)

func TestDocument

func TestDocument(cmdName string, t *testing.T)

Types

This section is empty.

Jump to

Keyboard shortcuts

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