mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-20 03:52:09 +08:00
init HttpBommer ✨🍰✨
This commit is contained in:
25
validate.go
Normal file
25
validate.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package httpboomer
|
||||
|
||||
// implements IStep interface
|
||||
type StepRequestValidation struct {
|
||||
*TStep
|
||||
}
|
||||
|
||||
func (req *StepRequestValidation) AssertEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation {
|
||||
validator := TValidator{
|
||||
Check: jmesPath,
|
||||
Comparator: "equals",
|
||||
Expect: expected,
|
||||
Message: msg,
|
||||
}
|
||||
req.TStep.Validators = append(req.TStep.Validators, validator)
|
||||
return req
|
||||
}
|
||||
|
||||
func (req *StepRequestValidation) ToStruct() *TStep {
|
||||
return req.TStep
|
||||
}
|
||||
|
||||
func (req *StepRequestValidation) Run() error {
|
||||
return req.TStep.Run()
|
||||
}
|
||||
Reference in New Issue
Block a user