diff options
author | Daniel Langesten <daniel.langest@gmail.com> | 2015-03-26 11:09:48 +0100 |
---|---|---|
committer | Daniel Langesten <daniel.langest@gmail.com> | 2015-03-26 11:09:48 +0100 |
commit | 986a05c215723b9227db20aa11a62e4d924281cb (patch) | |
tree | 6401602986bb32827b9defe43faa5e5e93c527f1 /flow-cleaner_test.go | |
parent | 54f6128240711a93551d85b000766a9b57cc96cf (diff) |
added verbose option to enable/disable extra output from the program
Diffstat (limited to 'flow-cleaner_test.go')
-rw-r--r-- | flow-cleaner_test.go | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/flow-cleaner_test.go b/flow-cleaner_test.go index 9be5d69..7c9673d 100644 --- a/flow-cleaner_test.go +++ b/flow-cleaner_test.go @@ -13,12 +13,16 @@ import ( "time" ) -func TestCleaningFromJSON(t *testing.T) { +func init() { + VERBOSE = true +} + +func TestCleaningFromDB(t *testing.T) { cfg := &Config{ Limit: 0, Interval: "5min", Epsilon: 0, - DataSource: "json", + DataSource: "mysql", DBConn: "", DBName: "test", @@ -28,21 +32,20 @@ func TestCleaningFromJSON(t *testing.T) { DBPass: "nil", } - fmt.Println("== Testing to process from stdin ==") + fmt.Println("== Testing to process from DB ==") prepareDB(t, cfg) - testProcessFromStdin(t, cfg) - time.Sleep(15 * time.Second) + processFromDB(cfg) controlCleanDB(t, cfg) - controlRawDBStdin(t, cfg) - fmt.Println("== Finished testing to process from stdin ==") + controlRawDBMySQL(t, cfg) + fmt.Println("== Finished testing to process from DB ==") } -func TestCleaningFromDB(t *testing.T) { +func TestCleaningFromJSON(t *testing.T) { cfg := &Config{ Limit: 0, Interval: "5min", Epsilon: 0, - DataSource: "mysql", + DataSource: "json", DBConn: "", DBName: "test", @@ -52,12 +55,13 @@ func TestCleaningFromDB(t *testing.T) { DBPass: "nil", } - fmt.Println("== Testing to process from DB ==") + fmt.Println("== Testing to process from stdin ==") prepareDB(t, cfg) - processFromDB(cfg) + testProcessFromStdin(t, cfg) + time.Sleep(15 * time.Second) controlCleanDB(t, cfg) - controlRawDBMySQL(t, cfg) - fmt.Println("== Finished testing to process from DB ==") + controlRawDBStdin(t, cfg) + fmt.Println("== Finished testing to process from stdin ==") } func prepareDB(t *testing.T, cfg *Config) { |