mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:40:55 +00:00
fix the orm test
This commit is contained in:
parent
0d0d87f600
commit
0711c3289f
4
app.go
4
app.go
@ -117,7 +117,7 @@ func (app *App) Run(mws ...MiddleWare) {
|
||||
app.Server.Addr = httpsAddr
|
||||
if BConfig.Listen.EnableHTTPS || BConfig.Listen.EnableMutualHTTPS {
|
||||
go func() {
|
||||
time.Sleep(20 * time.Microsecond)
|
||||
time.Sleep(1000 * time.Microsecond)
|
||||
if BConfig.Listen.HTTPSPort != 0 {
|
||||
httpsAddr = fmt.Sprintf("%s:%d", BConfig.Listen.HTTPSAddr, BConfig.Listen.HTTPSPort)
|
||||
app.Server.Addr = httpsAddr
|
||||
@ -163,7 +163,7 @@ func (app *App) Run(mws ...MiddleWare) {
|
||||
// run normal mode
|
||||
if BConfig.Listen.EnableHTTPS || BConfig.Listen.EnableMutualHTTPS {
|
||||
go func() {
|
||||
time.Sleep(20 * time.Microsecond)
|
||||
time.Sleep(1000 * time.Microsecond)
|
||||
if BConfig.Listen.HTTPSPort != 0 {
|
||||
app.Server.Addr = fmt.Sprintf("%s:%d", BConfig.Listen.HTTPSAddr, BConfig.Listen.HTTPSPort)
|
||||
} else if BConfig.Listen.EnableHTTP {
|
||||
|
@ -1008,13 +1008,13 @@ func TestAll(t *testing.T) {
|
||||
|
||||
qs = dORM.QueryTable("user")
|
||||
num, err = qs.Filter("user_name", "nothing").All(&users)
|
||||
throwFailNow(t, err)
|
||||
throwFailNow(t, AssertIs(err, ErrNoRows))
|
||||
throwFailNow(t, AssertIs(num, 0))
|
||||
|
||||
var users3 []*User
|
||||
qs = dORM.QueryTable("user")
|
||||
num, err = qs.Filter("user_name", "nothing").All(&users3)
|
||||
throwFailNow(t, err)
|
||||
throwFailNow(t, AssertIs(err, ErrNoRows))
|
||||
throwFailNow(t, AssertIs(num, 0))
|
||||
throwFailNow(t, AssertIs(users3 == nil, false))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user