forked from xormplus/xorm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext_test.go
More file actions
32 lines (24 loc) · 760 Bytes
/
context_test.go
File metadata and controls
32 lines (24 loc) · 760 Bytes
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
// Copyright 2017 The Xorm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build go1.8
package xorm
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestPingContext(t *testing.T) {
assert.NoError(t, prepareEngine())
ctx, canceled := context.WithTimeout(context.Background(), 10*time.Second)
defer canceled()
err := testEngine.(*Engine).PingContext(ctx)
assert.NoError(t, err)
// TODO: Since EngineInterface should be compitable with old Go version, PingContext is not supported.
/*
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
err := testEngine.PingContext(ctx)
assert.NoError(t, err)
*/
}