test

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 10 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 {
	*servertest.Tester
	// contains filtered or unexported fields
}

func NewSuite

func NewSuite(a *assert.Assertion) *Suite

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) NewModule

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

NewModule 新的模块

和正常的模块声明,少了对模块描述的指定,该值直接采用 id 值。

Jump to

Keyboard shortcuts

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