forked from smithoss/gonymizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloader_test.go
30 lines (24 loc) · 871 Bytes
/
loader_test.go
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
package gonymizer
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestLoaderTempDbCreation(t *testing.T) {
conf := GetTestDbConf(TestDb + "_ANONYMIZER_LOADING")
// Should come back with a DB created
require.Nil(t, CreateDatabase(conf))
require.Nil(t, DropDatabase(conf))
}
func TestLoadFile(t *testing.T) {
_ = CloseTestDb(TestLoadFileDb)
conf := GetTestDbConf(TestLoadFileDb)
require.Nil(t, CreateDatabase(conf))
require.Nil(t, LoadFile(conf, TestProcessDumpfile))
require.Nil(t, CloseTestDb(TestLoadFileDb))
}
func TestVerifyRowCount(t *testing.T) {
conf := GetTestDbConf(TestDb)
require.Nil(t, VerifyRowCount(conf, TestRowCountFile))
require.Nil(t, VerifyRowCount(conf, TestRowCountIncorrectRowCountsFile)) // Should return Nil and print a warning
require.NotNil(t, VerifyRowCount(conf, TestRowCountsIncorrectNumberColumnsFile))
}