diff options
Diffstat (limited to 'src/hub/src/spreadspace.org/sfive/s5store_test.go')
-rw-r--r-- | src/hub/src/spreadspace.org/sfive/s5store_test.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/hub/src/spreadspace.org/sfive/s5store_test.go b/src/hub/src/spreadspace.org/sfive/s5store_test.go new file mode 100644 index 0000000..3ff437e --- /dev/null +++ b/src/hub/src/spreadspace.org/sfive/s5store_test.go @@ -0,0 +1,37 @@ +package sfive + +import ( + "testing" + "time" +) + +func TestAppend(t *testing.T) { + store, err := NewStore() + if err != nil { + t.Errorf("Failed to initialize: %v", err) + } + defer EatDataAndClose(store) + + startTime := time.Date(2014, time.August, 24, 14, 35, 33, 847282000, time.UTC) + update := DataUpdate{Data: SourceData{BytesSent: 1, ClientCount: 3, BytesReceived: 1}, StartTime: startTime, Duration: 5 * time.Millisecond} + streamId := StreamId{ContentId: "content", Format: "7bitascii", Quality: QualityHigh} + source := SourceId{Hostname: "localhost", Tags: []string{"tag1", "master"}, StreamId: streamId} + dat := StatisticsData{source, update} + + err = store.Append(dat) + if err != nil { + t.Errorf("Failed to append: %v", err) + } +} + +func IgnoreTestCount(t *testing.T) { + store, err := NewStore() + if err != nil { + t.Errorf("Failed to initialize: %v", err) + } + defer EatDataAndClose(store) + + if 0 != store.ClientCount(nil) { + t.Errorf("Failed to count correctly.") + } +} |