(t *testing.T)
| 25 | ) |
| 26 | |
| 27 | func TestSQLFSNewSQLWriter(t *testing.T) { |
| 28 | createSQLFSTestingDatabaseOnce.Do(createSQLFSTestingDatabase) |
| 29 | db := database.GetTestingDBSingleton() |
| 30 | a := assert.New(t) |
| 31 | |
| 32 | if db.DriverName == "hive" { |
| 33 | t.Skip("Skip as SQLFLOW_TEST_DB is Hive") |
| 34 | } |
| 35 | t.Logf("Confirm executed with %s", db.DriverName) |
| 36 | |
| 37 | tbl := fmt.Sprintf("%s.unittest%d", testDatabaseName, rand.Int()) |
| 38 | w, e := newSQLWriter(db, tbl, bufSize) |
| 39 | a.NoError(e) |
| 40 | a.NotNil(w) |
| 41 | defer w.Close() |
| 42 | |
| 43 | has, e1 := hasTable(db.DB, tbl) |
| 44 | a.NoError(e1) |
| 45 | a.True(has) |
| 46 | |
| 47 | a.NoError(dropTableIfExists(db.DB, tbl)) |
| 48 | } |
| 49 | |
| 50 | func TestSQLFSSQLWriterWriteAndRead(t *testing.T) { |
| 51 | createSQLFSTestingDatabaseOnce.Do(createSQLFSTestingDatabase) |
nothing calls this directly
no test coverage detected