Skip to content

Commit

Permalink
Add calls in unit tests to cover logging and jsonify of video object.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaynardxandr committed Dec 13, 2019
1 parent 275e8c8 commit 03648bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions analytics/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ func TestSampleModule(t *testing.T) {
if count != 4 {
t.Errorf("PBSAnalyticsModule failed at LogAmpObject")
}

am.LogVideoObject(&analytics.VideoObject{})
if count != 5 {
t.Errorf("PBSAnalyticsModule failed at LogVideoObject")
}
}

type sampleModule struct {
Expand Down
10 changes: 10 additions & 0 deletions analytics/filesystem/file_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ func TestAuctionObject_ToJson(t *testing.T) {
}
}

func TestVideoObject_ToJson(t *testing.T) {
vo := &analytics.VideoObject{
Status: http.StatusOK,
}
if voJson := jsonifyVideoObject(vo); strings.Contains(voJson, "Transactional Logs Error") {
t.Fatalf("AuctionObject failed to convert to json")
}
}

func TestSetUIDObject_ToJson(t *testing.T) {
so := &analytics.SetUIDObject{
Status: http.StatusOK,
Expand Down Expand Up @@ -64,6 +73,7 @@ func TestFileLogger_LogObjects(t *testing.T) {
defer os.RemoveAll(TEST_DIR)
if fl, err := NewFileLogger(TEST_DIR + "//test"); err == nil {
fl.LogAuctionObject(&analytics.AuctionObject{})
fl.LogVideoObject(&analytics.VideoObject{})
fl.LogAmpObject(&analytics.AmpObject{})
fl.LogSetUIDObject(&analytics.SetUIDObject{})
fl.LogCookieSyncObject(&analytics.CookieSyncObject{})
Expand Down

0 comments on commit 03648bb

Please sign in to comment.