mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 20:30:55 +00:00
update the test case
This commit is contained in:
parent
15242d89ce
commit
000033e2a7
@ -29,7 +29,10 @@ func TestCookie(t *testing.T) {
|
|||||||
}
|
}
|
||||||
r, _ := http.NewRequest("GET", "/", nil)
|
r, _ := http.NewRequest("GET", "/", nil)
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
sess := globalSessions.SessionStart(w, r)
|
sess, err := globalSessions.SessionStart(w, r)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal("set error,", err)
|
||||||
|
}
|
||||||
err = sess.Set("username", "astaxie")
|
err = sess.Set("username", "astaxie")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal("set error,", err)
|
t.Fatal("set error,", err)
|
||||||
|
@ -26,9 +26,12 @@ func TestMem(t *testing.T) {
|
|||||||
go globalSessions.GC()
|
go globalSessions.GC()
|
||||||
r, _ := http.NewRequest("GET", "/", nil)
|
r, _ := http.NewRequest("GET", "/", nil)
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
sess := globalSessions.SessionStart(w, r)
|
sess, err := globalSessions.SessionStart(w, r)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal("set error,", err)
|
||||||
|
}
|
||||||
defer sess.SessionRelease(w)
|
defer sess.SessionRelease(w)
|
||||||
err := sess.Set("username", "astaxie")
|
err = sess.Set("username", "astaxie")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal("set error,", err)
|
t.Fatal("set error,", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user