test

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package test 初始化测试环境

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Suite

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

func NewSuite

func NewSuite(a *assert.Assertion) *Suite

NewSuite 新建测试套件

func (*Suite) Assertion

func (s *Suite) Assertion() *assert.Assertion

func (*Suite) Close

func (s *Suite) Close()

Close 关闭服务

如果未手动调用,则在 testing.TB.Cleanup 中自动关闭。 部分功能需要手动调用此方法,比如要主动关闭服务才能退出的路由测试。

func (*Suite) DB

func (s *Suite) DB() *orm.DB

func (*Suite) Delete

func (s *Suite) Delete(url string) *rest.Request

func (*Suite) Get

func (s *Suite) Get(url string) *rest.Request

func (*Suite) Module

func (s *Suite) Module() *cmfx.Module

func (*Suite) NewModule

func (s *Suite) NewModule(id string) *cmfx.Module

func (*Suite) NewRequest

func (s *Suite) NewRequest(method, url string) *rest.Request

func (*Suite) Patch added in v0.8.3

func (s *Suite) Patch(url string, body []byte) *rest.Request

func (*Suite) Post

func (s *Suite) Post(url string, body []byte) *rest.Request

func (*Suite) Put

func (s *Suite) Put(url string, body []byte) *rest.Request

func (*Suite) Router

func (s *Suite) Router() *web.Router

func (*Suite) TableExists

func (s *Suite) TableExists(name string) *Suite

Jump to

Keyboard shortcuts

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