forked from goplus/yap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgop_autogen_test.go
57 lines (54 loc) · 1.46 KB
/
gop_autogen_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Code generated by gop (Go+); DO NOT EDIT.
package main
import (
"github.com/goplus/yap/test"
"github.com/goplus/yap/ytest"
"github.com/qiniu/x/stringutil"
"testing"
)
type case_bar struct {
ytest.CaseApp
}
type case_foo struct {
ytest.CaseApp
}
//line ytest/demo/foo/bar_ytest.gox:1
func (this *case_bar) Main() {
//line ytest/demo/foo/bar_ytest.gox:1:1
this.TestServer("foo.com", new(AppV2))
//line ytest/demo/foo/bar_ytest.gox:3:1
id := "123"
//line ytest/demo/foo/bar_ytest.gox:4:1
this.Get(stringutil.Concat("http://foo.com/p/", id))
//line ytest/demo/foo/bar_ytest.gox:5:1
this.Send()
//line ytest/demo/foo/bar_ytest.gox:6:1
test.Gopt_Case_MatchTBase(this, this.Resp().Code(), 200)
//line ytest/demo/foo/bar_ytest.gox:7:1
this.Json(map[string]string{"id": id})
}
func (this *case_bar) Classfname() string {
return "bar"
}
//line ytest/demo/foo/foo_ytest.gox:1
func (this *case_foo) Main() {
//line ytest/demo/foo/foo_ytest.gox:1:1
this.Mock("foo.com", new(AppV2))
//line ytest/demo/foo/foo_ytest.gox:3:1
id := "123"
//line ytest/demo/foo/foo_ytest.gox:4:1
this.Get(stringutil.Concat("http://foo.com/p/", id))
//line ytest/demo/foo/foo_ytest.gox:5:1
this.RetWith(200)
//line ytest/demo/foo/foo_ytest.gox:6:1
this.Json(map[string]string{"id": id})
}
func (this *case_foo) Classfname() string {
return "foo"
}
func Test_bar(t *testing.T) {
ytest.Gopt_CaseApp_TestMain(new(case_bar), t)
}
func Test_foo(t *testing.T) {
ytest.Gopt_CaseApp_TestMain(new(case_foo), t)
}