Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Commit

Permalink
Remove obsolete test for ByStatus slice
Browse files Browse the repository at this point in the history
  • Loading branch information
metalmatze committed Nov 4, 2017
1 parent f69a7e1 commit 2bc6be2
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions silences_test.go
Original file line number Diff line number Diff line change
@@ -1,42 +1,13 @@
package main

import (
"sort"
"testing"
"time"

"github.com/prometheus/alertmanager/types"
"github.com/stretchr/testify/assert"
)

func TestByStatus(t *testing.T) {
s1 := types.Silence{EndsAt: time.Now().Add(-2 * time.Minute)}
s2 := types.Silence{EndsAt: time.Now().Add(-1 * time.Minute)}
s3 := types.Silence{EndsAt: time.Now().Add(1 * time.Minute)}
s4 := types.Silence{EndsAt: time.Now().Add(2 * time.Minute)}

bs := ByStatus{s1}
sort.Sort(bs)
assert.Equal(t, s1, bs[0])

bs = ByStatus{s4, s1}
sort.Sort(bs)
assert.Equal(t, s4, bs[0])
assert.Equal(t, s1, bs[1])

bs = ByStatus{s3, s2}
sort.Sort(bs)
assert.Equal(t, s3, bs[0])
assert.Equal(t, s2, bs[1])

bs = ByStatus{s4, s2, s3, s1}
sort.Sort(bs)
assert.Equal(t, s4, bs[0])
assert.Equal(t, s3, bs[1])
assert.Equal(t, s2, bs[2])
assert.Equal(t, s1, bs[3])
}

func TestResolved(t *testing.T) {
s := types.Silence{}
assert.False(t, Resolved(s))
Expand Down

0 comments on commit 2bc6be2

Please sign in to comment.