new-sql-view
William Perron 11 months ago
parent 0a9cc8d7e0
commit 7f78dcdc67
Signed by: wperron
GPG Key ID: BFDB4EF72D73C5F2

@ -1,6 +1,7 @@
package themis
import (
"context"
"fmt"
"testing"
@ -14,7 +15,7 @@ func TestFormatRows(t *testing.T) {
rows, err := store.db.Query("SELECT provinces.name, provinces.region, provinces.area, provinces.trade_node FROM provinces WHERE area = 'Gascony'")
assert.NoError(t, err)
fmtd, err := FormatRows(rows)
fmtd, err := FormatRows(context.Background(), rows)
assert.NoError(t, err)
assert.Equal(t, `| name | region | area | trade_node |
| -------- | ------ | ------- | ---------- |
@ -32,7 +33,7 @@ func TestFormatRowsAggregated(t *testing.T) {
rows, err := store.db.Query("SELECT count(1) as total, trade_node from provinces where region = 'France' group by trade_node")
assert.NoError(t, err)
fmtd, err := FormatRows(rows)
fmtd, err := FormatRows(context.Background(), rows)
assert.NoError(t, err)
assert.Equal(t, `| total | trade_node |
| ----- | --------------- |

Loading…
Cancel
Save