Setup the filesource with schema info
(s *schema.Schema)
| 50 | |
| 51 | // Setup the filesource with schema info |
| 52 | func (m *testSource) Setup(s *schema.Schema) error { |
| 53 | |
| 54 | fileStore := "localfs" |
| 55 | if os.Getenv("FILESTORE") != "" { |
| 56 | fileStore = os.Getenv("FILESTORE") |
| 57 | } |
| 58 | |
| 59 | settings := u.JsonHelper(map[string]interface{}{ |
| 60 | "path": "baseball", |
| 61 | "filetype": "csv", |
| 62 | "type": fileStore, |
| 63 | }) |
| 64 | s.Conf = &schema.ConfigSource{ |
| 65 | Name: "testcsvs", |
| 66 | SourceType: "testcsvs", |
| 67 | Settings: settings, |
| 68 | } |
| 69 | return m.FileSource.Setup(s) |
| 70 | } |
| 71 | |
| 72 | func TestFileList(t *testing.T) { |
| 73 | testutil.TestSqlSelect(t, "testcsvs", `show databases;`, |