tests

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2017 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KEY_STATUS = "expected-status"
	KEY_BODY   = "expected-body"
	KEY_FILTER = "expected-filter"
)
View Source
const (
	REPORT_FAILED  = 0
	REPORT_SKIPPED = 1
	REPORT_SUCCESS = 2
)
View Source
const ABC_NICK = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_."
View Source
const ABC_SLUG = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-"
View Source
const POST_FAKE_ID int64 = 2139800938
View Source
const THREAD_FAKE_ID = "2139800939"

Variables

This section is empty.

Functions

func CheckClear added in v0.1.0

func CheckClear(c *client.Forum)

func CheckForum

func CheckForum(c *client.Forum, forum *models.Forum)

func CheckForumCreateConflict

func CheckForumCreateConflict(c *client.Forum, m *Modify)

func CheckForumCreateSimple

func CheckForumCreateSimple(c *client.Forum)

func CheckForumCreateUnicode

func CheckForumCreateUnicode(c *client.Forum)

func CheckForumCreateUserCase

func CheckForumCreateUserCase(c *client.Forum, m *Modify)

func CheckForumCreateUserNotFound

func CheckForumCreateUserNotFound(c *client.Forum)

func CheckForumGetOneNocase

func CheckForumGetOneNocase(c *client.Forum, m *Modify)

func CheckForumGetOneNotFound

func CheckForumGetOneNotFound(c *client.Forum)

func CheckForumGetOneSimple

func CheckForumGetOneSimple(c *client.Forum)

func CheckForumGetThreadsNotFound added in v0.1.0

func CheckForumGetThreadsNotFound(c *client.Forum, m *Modify)

func CheckForumGetThreadsSimple added in v0.1.0

func CheckForumGetThreadsSimple(c *client.Forum, m *Modify)

func CheckForumGetUsersEmpty added in v0.1.0

func CheckForumGetUsersEmpty(c *client.Forum, m *Modify)

func CheckForumGetUsersNotFound added in v0.1.0

func CheckForumGetUsersNotFound(c *client.Forum, m *Modify)

func CheckForumGetUsersSimple added in v0.1.0

func CheckForumGetUsersSimple(c *client.Forum, m *Modify)

func CheckForumGetUsersVote added in v0.1.0

func CheckForumGetUsersVote(c *client.Forum, m *Modify)

func CheckIsType

func CheckIsType(expectedType interface{}, object interface{})

func CheckNil

func CheckNil(err interface{})

func CheckPost

func CheckPost(c *client.Forum, post *models.Post)

func CheckPostCreateDeepParent added in v0.1.0

func CheckPostCreateDeepParent(c *client.Forum)

func CheckPostCreateEmpty added in v0.1.0

func CheckPostCreateEmpty(c *client.Forum, m *Modify)

func CheckPostCreateInvalidParent added in v0.1.0

func CheckPostCreateInvalidParent(c *client.Forum, m *Modify)

func CheckPostCreateNoAuthor added in v0.1.0

func CheckPostCreateNoAuthor(c *client.Forum, m *Modify)

func CheckPostCreateNoThread added in v0.1.0

func CheckPostCreateNoThread(c *client.Forum, m *Modify)

func CheckPostCreateSimple

func CheckPostCreateSimple(c *client.Forum, m *Modify)

func CheckPostCreateUnicode added in v0.1.0

func CheckPostCreateUnicode(c *client.Forum)

func CheckPostCreateWithParent added in v0.1.0

func CheckPostCreateWithParent(c *client.Forum)

func CheckPostGetOneNotFound added in v0.1.0

func CheckPostGetOneNotFound(c *client.Forum, m *Modify)

func CheckPostGetOneRelated added in v0.1.0

func CheckPostGetOneRelated(c *client.Forum, m *Modify)

func CheckPostGetOneSimple added in v0.1.0

func CheckPostGetOneSimple(c *client.Forum)

func CheckPostUpdateCase added in v0.1.0

func CheckPostUpdateCase(c *client.Forum)

func CheckPostUpdateEmpty added in v0.1.0

func CheckPostUpdateEmpty(c *client.Forum)

func CheckPostUpdateNotFound added in v0.1.0

func CheckPostUpdateNotFound(c *client.Forum)

func CheckPostUpdateSame added in v0.1.0

func CheckPostUpdateSame(c *client.Forum)

func CheckPostUpdateSimple added in v0.1.0

func CheckPostUpdateSimple(c *client.Forum)

func CheckStatus added in v0.1.0

func CheckStatus(c *client.Forum)

func CheckThread

func CheckThread(c *client.Forum, thread *models.Thread)

func CheckThreadCreateConflict added in v0.1.0

func CheckThreadCreateConflict(c *client.Forum, m *Modify)

func CheckThreadCreateNoAuthor added in v0.1.0

func CheckThreadCreateNoAuthor(c *client.Forum)

func CheckThreadCreateNoCase added in v0.1.0

func CheckThreadCreateNoCase(c *client.Forum, m *Modify)

func CheckThreadCreateNoForum added in v0.1.0

func CheckThreadCreateNoForum(c *client.Forum)

func CheckThreadCreateSimple

func CheckThreadCreateSimple(c *client.Forum, m *Modify)

func CheckThreadCreateUnicode added in v0.1.0

func CheckThreadCreateUnicode(c *client.Forum)

func CheckThreadGetOneNotFound added in v0.1.0

func CheckThreadGetOneNotFound(c *client.Forum)

func CheckThreadGetOneSimple added in v0.1.0

func CheckThreadGetOneSimple(c *client.Forum, m *Modify)

func CheckThreadGetPostsNotFound added in v0.1.0

func CheckThreadGetPostsNotFound(c *client.Forum)

func CheckThreadGetPostsSimple added in v0.1.0

func CheckThreadGetPostsSimple(c *client.Forum, m *Modify)

func CheckThreadUpdateEmpty added in v0.1.0

func CheckThreadUpdateEmpty(c *client.Forum)

func CheckThreadUpdateNotFound added in v0.1.0

func CheckThreadUpdateNotFound(c *client.Forum)

func CheckThreadUpdatePart added in v0.1.0

func CheckThreadUpdatePart(c *client.Forum, m *Modify)

func CheckThreadUpdateSimple added in v0.1.0

func CheckThreadUpdateSimple(c *client.Forum, m *Modify)

func CheckThreadVoteSimple added in v0.1.0

func CheckThreadVoteSimple(c *client.Forum)

func CheckThreadVoteThreadNotFound added in v0.1.0

func CheckThreadVoteThreadNotFound(c *client.Forum)

func CheckThreadVoteUserNotFound added in v0.1.0

func CheckThreadVoteUserNotFound(c *client.Forum)

func CheckUser

func CheckUser(c *client.Forum, user *models.User)

func CheckUserCreateConflict

func CheckUserCreateConflict(c *client.Forum, m *Modify)

func CheckUserCreateSimple

func CheckUserCreateSimple(c *client.Forum)

func CheckUserCreateUnicode

func CheckUserCreateUnicode(c *client.Forum)

func CheckUserGetOneNocase

func CheckUserGetOneNocase(c *client.Forum, m *Modify)

func CheckUserGetOneNotFound

func CheckUserGetOneNotFound(c *client.Forum)

func CheckUserGetOneSimple

func CheckUserGetOneSimple(c *client.Forum)

func CheckUserUpdateConflict

func CheckUserUpdateConflict(c *client.Forum, m *Modify)

func CheckUserUpdateEmpty

func CheckUserUpdateEmpty(c *client.Forum)

func CheckUserUpdateNotFound

func CheckUserUpdateNotFound(c *client.Forum)

func CheckUserUpdatePart

func CheckUserUpdatePart(c *client.Forum, m *Modify)

func CheckUserUpdateSimple

func CheckUserUpdateSimple(c *client.Forum)

func Checkpoint

func Checkpoint(c *client.Forum, message string) bool

func CreateForum

func CreateForum(c *client.Forum, forum *models.Forum, owner *models.User) *models.Forum

func CreatePost

func CreatePost(c *client.Forum, post *models.Post, thread *models.Thread) *models.Post

func CreatePosts added in v0.1.0

func CreatePosts(c *client.Forum, posts []*models.Post, thread *models.Thread) []*models.Post

func CreateThread

func CreateThread(c *client.Forum, thread *models.Thread, forum *models.Forum, author *models.User) *models.Thread

func CreateUser

func CreateUser(c *client.Forum, user *models.User) *models.User

func Expected

func Expected(statusCode int, body interface{}, prepare Filter) context.Context

func GetBody

func GetBody(stream *io.ReadCloser) ([]byte, error)

func GetDelta

func GetDelta(data []byte, expected interface{}, prepare Filter) string

func GetDiff

func GetDiff(actual string, expected string) string

func InvertCase added in v0.1.0

func InvertCase(str string) string

func Modifications added in v0.1.0

func Modifications(checker func(c *client.Forum, modify *Modify)) func(c *client.Forum)

func ObjectsAreEqual

func ObjectsAreEqual(expected, actual interface{}) bool

func RandomEmail

func RandomEmail() strfmt.Email

func RandomForum

func RandomForum() *models.Forum

func RandomMarker added in v0.1.0

func RandomMarker() string

func RandomNickname

func RandomNickname() string

func RandomPost

func RandomPost() *models.Post

func RandomThread

func RandomThread() *models.Thread

func RandomTime added in v0.1.0

func RandomTime() time.Time

func RandomUser

func RandomUser() *models.User

func Register

func Register(checker Checker)

func RequestToText

func RequestToText(req *http.Request) string

func ResponseToText

func ResponseToText(res *http.Response) string

func Run

func Run(url *url.URL) int

func RunCheck

func RunCheck(check Checker, report *Report, cfg *client.TransportConfig)

func SortPosts added in v0.1.0

func SortPosts(posts []OrderedPost, desc bool, limitType func(OrderedPost) int, limit int) [][]*models.Post

func ToJson

func ToJson(obj interface{}) string

Types

type Checker

type Checker struct {
	// Имя текущей проверки.
	Name string
	// Описание текущей проверки.
	Description string
	// Функция для текущей проверки.
	FnCheck func(c *client.Forum)
	// Тесты, без которых проверка не имеет смысл.
	Deps []string
}

type CheckerTransport

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

func (*CheckerTransport) Submit

func (self *CheckerTransport) Submit(operation *runtime.ClientOperation) (interface{}, error)

type Filter

type Filter func(interface{}) interface{}

type Modify added in v0.1.0

type Modify int

func (*Modify) Bool added in v0.1.0

func (self *Modify) Bool() bool

func (*Modify) Case added in v0.1.0

func (self *Modify) Case(source string) string

func (*Modify) Int added in v0.1.0

func (self *Modify) Int(n int) int

func (*Modify) NullableBool added in v0.1.0

func (self *Modify) NullableBool() *bool

func (*Modify) SlugOrId added in v0.1.0

func (self *Modify) SlugOrId(thread *models.Thread) string

type OrderedPost added in v0.1.0

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

func CreateTree added in v0.1.0

func CreateTree(c *client.Forum, thread *models.Thread) []OrderedPost

type PostSortTree added in v0.1.0

type PostSortTree []OrderedPost

func (PostSortTree) Len added in v0.1.0

func (a PostSortTree) Len() int

func (PostSortTree) Less added in v0.1.0

func (a PostSortTree) Less(i, j int) bool

func (PostSortTree) Swap added in v0.1.0

func (a PostSortTree) Swap(i, j int)

type Report

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

func (*Report) AddError

func (self *Report) AddError(err interface{})

func (*Report) Checkpoint

func (self *Report) Checkpoint(message string) bool

func (*Report) RoundTrip

func (self *Report) RoundTrip(req *http.Request, res *http.Response, example *http.Response, message *string)

func (*Report) Show

func (self *Report) Show()

type ThreadByCreated added in v0.1.0

type ThreadByCreated []models.Thread

func (ThreadByCreated) Len added in v0.1.0

func (a ThreadByCreated) Len() int

func (ThreadByCreated) Less added in v0.1.0

func (a ThreadByCreated) Less(i, j int) bool

func (ThreadByCreated) Swap added in v0.1.0

func (a ThreadByCreated) Swap(i, j int)

type UserByNickname

type UserByNickname []models.User

func (UserByNickname) Len

func (a UserByNickname) Len() int

func (UserByNickname) Less

func (a UserByNickname) Less(i, j int) bool

func (UserByNickname) Swap

func (a UserByNickname) Swap(i, j int)

type Validator

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

func NewValidator

func NewValidator(ctx context.Context, report *Report) *Validator

func (*Validator) Example

func (self *Validator) Example(req *http.Request) *http.Response

func (*Validator) RoundTrip

func (self *Validator) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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