mirror of https://github.com/dirtbags/moth.git
Fixing some more test issues
This commit is contained in:
parent
75733415c3
commit
a81e3aa62f
|
@ -147,7 +147,10 @@ func TestStatePointsRemoval(t *testing.T) {
|
||||||
points2 := points1 + 1
|
points2 := points1 + 1
|
||||||
|
|
||||||
|
|
||||||
s.AwardPoints(team, category, points1)
|
if err := s.AwardPoints(team, category, points1); err != nil {
|
||||||
|
t.Logf("Received unexpected error: %s", err)
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
s.refresh()
|
s.refresh()
|
||||||
|
|
||||||
pointsLogLength := len(s.PointsLog())
|
pointsLogLength := len(s.PointsLog())
|
||||||
|
@ -156,7 +159,10 @@ func TestStatePointsRemoval(t *testing.T) {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
s.AwardPoints(team, category, points2)
|
if err := s.AwardPoints(team, category, points2); err != nil {
|
||||||
|
t.Logf("Received unexpected error: %s", err)
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
s.refresh()
|
s.refresh()
|
||||||
|
|
||||||
pointsLogLength = len(s.PointsLog())
|
pointsLogLength = len(s.PointsLog())
|
||||||
|
@ -165,7 +171,10 @@ func TestStatePointsRemoval(t *testing.T) {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
s.RemovePoints(team, category, points1)
|
if err := s.RemovePoints(team, category, points1); err != nil {
|
||||||
|
t.Logf("Received unexpected error: %s", err)
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
s.refresh()
|
s.refresh()
|
||||||
|
|
||||||
pointsLog := s.PointsLog()
|
pointsLog := s.PointsLog()
|
||||||
|
@ -180,7 +189,10 @@ func TestStatePointsRemoval(t *testing.T) {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
s.RemovePoints(team, category, points1)
|
if err := s.RemovePoints(team, category, points1); err != nil {
|
||||||
|
t.Logf("Received unexpected error: %s", err)
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
s.refresh()
|
s.refresh()
|
||||||
|
|
||||||
pointsLog = s.PointsLog()
|
pointsLog = s.PointsLog()
|
||||||
|
@ -190,7 +202,10 @@ func TestStatePointsRemoval(t *testing.T) {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
s.RemovePoints(team, category, points2)
|
if err := s.RemovePoints(team, category, points2); err != nil {
|
||||||
|
t.Logf("Received unexpected error: %s", err)
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
s.refresh()
|
s.refresh()
|
||||||
|
|
||||||
pointsLog = s.PointsLog()
|
pointsLog = s.PointsLog()
|
||||||
|
@ -469,19 +484,13 @@ func TestMessage(t *testing.T) {
|
||||||
|
|
||||||
message := "foobar"
|
message := "foobar"
|
||||||
|
|
||||||
retrievedMessage := s.Messages()
|
|
||||||
if (retrievedMessage != "") {
|
|
||||||
t.Logf("Expected empty message, received '%s' instead", retrievedMessage)
|
|
||||||
t.Fail()
|
|
||||||
}
|
|
||||||
|
|
||||||
if err:= s.SetMessages(message); err != nil {
|
if err:= s.SetMessages(message); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.refresh()
|
s.refresh()
|
||||||
|
|
||||||
retrievedMessage = s.Messages()
|
retrievedMessage := s.Messages()
|
||||||
|
|
||||||
if (retrievedMessage != message) {
|
if (retrievedMessage != message) {
|
||||||
t.Logf("Expected message '%s', received '%s', instead", message, retrievedMessage)
|
t.Logf("Expected message '%s', received '%s', instead", message, retrievedMessage)
|
||||||
|
|
Loading…
Reference in New Issue