Skip to content

Commit

Permalink
tighten up test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicpottier committed Aug 22, 2017
1 parent 7cf135e commit 59a06f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backends/rapidpro/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,10 @@ func (ts *MsgTestSuite) TestWriteMsg() {
err := ts.b.WriteMsg(msg)
ts.NoError(err)

// creating the incoming msg again should give us the same UUID and have the msg set as not to write
msg2 := ts.b.NewIncomingMsg(knChannel, urn, "test123").(*DBMsg)
ts.Equal(msg2.UUID(), msg.UUID())

// check we had an id set
ts.NotZero(msg.ID)

Expand Down Expand Up @@ -503,10 +507,6 @@ func (ts *MsgTestSuite) TestWriteMsg() {
ts.NotNil(contact.UUID)
ts.NotNil(contact.ID)

// creating the incoming msg again should give us the same UUID and have the msg set as not to write
msg2 := ts.b.NewIncomingMsg(knChannel, urn, "test123").(*DBMsg)
ts.Equal(msg2.UUID(), msg.UUID())

// waiting 5 seconds should let us write it successfully
time.Sleep(5 * time.Second)
msg3 := ts.b.NewIncomingMsg(knChannel, urn, "test123").(*DBMsg)
Expand Down

0 comments on commit 59a06f8

Please sign in to comment.