scenario

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMongoActive

func CheckMongoActive(t *testing.T)

func CreateSdk added in v1.0.1

func CreateSdk() *v2_gots_sdk.ApiSdk

func GetBaseTestAsset

func GetBaseTestAsset(elem ...string) string

func GetDb

func GetDb() *gorm.DB

TODO: bakalan deprecated soale ada test scenario

func GetTokopediaApiClient

func GetTokopediaApiClient() (*api.TokopediaApi, func())

func NewMongoDatabase added in v1.0.2

func NewMongoDatabase(ctx context.Context, dburi string, dbname string) *mongo.Database

func RunWebSdk added in v1.0.1

func RunWebSdk(t *testing.T, handler RunHandler)

Types

type ConfigTest

type ConfigTest struct {
	MongoUri string `json:"mongo_uri"`
}
var CfgTest *ConfigTest

func CheckConfig

func CheckConfig(t *testing.T) *ConfigTest

func (*ConfigTest) GetHostPort

func (cfg *ConfigTest) GetHostPort() (string, string)

type RunHandler added in v1.0.1

type RunHandler func(sdk *v2_gots_sdk.ApiSdk, sendApi SendRequest) error

type Scenario added in v1.0.2

type Scenario struct {
	Base string
	// contains filtered or unexported fields
}

func NewScenario added in v1.0.2

func NewScenario(t *testing.T) *Scenario

func (*Scenario) Path added in v1.1.2

func (scen *Scenario) Path(data ...string) string

func (*Scenario) WithBase added in v1.0.2

func (scen *Scenario) WithBase(handler func(dirbase string, scen *Scenario))

func (*Scenario) WithCopySqliteDatabase added in v1.0.2

func (scen *Scenario) WithCopySqliteDatabase(handler func(db *gorm.DB))

func (*Scenario) WithMongoDatabase added in v1.0.2

func (scen *Scenario) WithMongoDatabase(cfg *config.UploadBaseConfig, handler func(mongodb *mongo.Database))

func (*Scenario) WithSqliteDatabase added in v1.0.2

func (scen *Scenario) WithSqliteDatabase(handler func(db *gorm.DB))

func (*Scenario) WithUploadConfig added in v1.0.2

func (scen *Scenario) WithUploadConfig(cfgmodifier func(cfg *config.UploadBaseConfig) error, handler func(cfg *config.UploadBaseConfig))

type SendRequest added in v1.0.1

type SendRequest func(req *v2_gots_sdk.Api) *httptest.ResponseRecorder

Jump to

Keyboard shortcuts

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