Skip to content

Commit

Permalink
fix time zone in datatype_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixolay authored and Nix O Live committed Sep 18, 2019
1 parent 1bec364 commit a44e320
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion datatypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (event *NotificationEvent) CreateMessage(loc *time.Location) string {

tz := ""
if loc == nil {
loc = time.Local
loc = time.UTC
tz = "(MST)"
}

Expand Down
6 changes: 3 additions & 3 deletions datatypes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestNotificationEvent_CreateMessage(t *testing.T) {
So(event.CreateMessage(nil), ShouldEqual, "")
})
Convey("Test: check for void location", func() {
expected := "This metric changed its state during maintenance interval. Maintenance was set at 05:01 01.01.1970(+05)."
expected := "This metric changed its state during maintenance interval. Maintenance was set at 00:01 01.01.1970(UTC)."
event := NotificationEvent{EventMessage: EventInfo{
Info: &MaintenanceInfo{StartTime: &startTime},
}}
Expand All @@ -171,11 +171,11 @@ func TestNotificationEvent_CreateMessage(t *testing.T) {
So(event.CreateMessage(nil), ShouldEqual, expected)
})
Convey("Test: removed by stop user and time", func() {
expected := "This metric changed its state during maintenance interval. Maintenance was set by StartUser and removed by StopUser at 05:03 01.01.1970(+05)."
expected := "This metric changed its state during maintenance interval. Maintenance was set by StartUser and removed by StopUser at 00:03 01.01.1970."
event := NotificationEvent{EventMessage: EventInfo{
Info: &MaintenanceInfo{StartUser: &startUser, StopUser: &stopUser, StopTime: &stopTime},
}}
So(event.CreateMessage(time.Local), ShouldEqual, expected)
So(event.CreateMessage(time.UTC), ShouldEqual, expected)
})
})
}
Expand Down

0 comments on commit a44e320

Please sign in to comment.