Skip to content

Commit

Permalink
Added test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyacheslav-Stepanov authored and Vyacheslav-Stepanov committed Jul 2, 2020
1 parent af37215 commit abcb88b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions conn_test.go
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"database/sql/driver"
"io/ioutil"
"net/http"
"testing"
"time"
Expand Down Expand Up @@ -367,6 +368,18 @@ func (s *connSuite) TestBuildRequestWithQueryIdAndQuotaKey() {
}
}
}
func (s *connSuite) TestBuildRequestParamsInterpolation() {
query := `INSERT INTO test (str) VALUES ("Question?")`
cn := newConn(NewConfig())
req, err := cn.buildRequest(context.Background(), query, make([]driver.Value, 0), false)
if s.NoError(err) {
body, e := ioutil.ReadAll(req.Body)
if s.NoError(e) {
s.Equal(query, string(body))
}
}
}

func TestConn(t *testing.T) {
suite.Run(t, new(connSuite))
}

0 comments on commit abcb88b

Please sign in to comment.