Skip to content

Commit

Permalink
PingContext test
Browse files Browse the repository at this point in the history
  • Loading branch information
xormplus committed Sep 26, 2018
1 parent 25868fc commit 95c6519
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@
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)
Expand Down

0 comments on commit 95c6519

Please sign in to comment.