forked from viant/dsunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatic_test.go
More file actions
executable file
·31 lines (24 loc) · 818 Bytes
/
static_test.go
File metadata and controls
executable file
·31 lines (24 loc) · 818 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
package dsunit_test
import (
"testing"
_ "github.com/mattn/go-sqlite3"
"github.com/viant/dsunit"
"time"
)
func TestTableMapping(t *testing.T) {
dsunit.InitFromURL(t, "test/static/init.json")
dsunit.PrepareFor(t, "static", "test/static/data", "mapping")
//business test logic comes here
dsunit.ExpectFor(t, "static", dsunit.SnapshotDatasetCheckPolicy, "test/static/data", "mapping")
}
func TestTableMappingRemote(t *testing.T) {
go func() {
dsunit.StartServer("8877")
}()
time.Sleep(time.Second)
tester := dsunit.NewRemoveTester("http://127.0.0.1:8877")
tester.InitFromURL(t, "test/static/init.json")
tester.PrepareFor(t, "static", "test/static/data", "mapping")
//business test logic comes here
tester.ExpectFor(t, "static", dsunit.SnapshotDatasetCheckPolicy, "test/static/data", "mapping")
}