1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-24 04:57:02 +00:00

More testing

Test DATA on handler
Add a 2 second wait if the test fails so that all the logging data can
be collected.
This commit is contained in:
James Hillyerd
2013-10-30 14:42:55 -07:00
parent 038f4fafd3
commit b2c3c4ce0f
2 changed files with 61 additions and 0 deletions

View File

@@ -90,6 +90,8 @@ func TestFSDirStructure(t *testing.T) {
assert.False(t, isPresent(expect), "Did not expect %q to exist", expect)
if t.Failed() {
// Wait for handler to finish logging
time.Sleep(2 * time.Second)
// Dump buffered log data if there was a failure
io.Copy(os.Stderr, logbuf)
}
@@ -115,6 +117,8 @@ func TestFSAllMailboxes(t *testing.T) {
assert.Equal(t, len(mboxes), 5)
if t.Failed() {
// Wait for handler to finish logging
time.Sleep(2 * time.Second)
// Dump buffered log data if there was a failure
io.Copy(os.Stderr, logbuf)
}
@@ -163,6 +167,8 @@ func TestFSDeliverMany(t *testing.T) {
}
if t.Failed() {
// Wait for handler to finish logging
time.Sleep(2 * time.Second)
// Dump buffered log data if there was a failure
io.Copy(os.Stderr, logbuf)
}
@@ -235,6 +241,8 @@ func TestFSDelete(t *testing.T) {
}
if t.Failed() {
// Wait for handler to finish logging
time.Sleep(2 * time.Second)
// Dump buffered log data if there was a failure
io.Copy(os.Stderr, logbuf)
}
@@ -281,6 +289,8 @@ func TestFSPurge(t *testing.T) {
assert.Equal(t, len(msgs), 0, "Expected mailbox to have zero messages, got %v", len(msgs))
if t.Failed() {
// Wait for handler to finish logging
time.Sleep(2 * time.Second)
// Dump buffered log data if there was a failure
io.Copy(os.Stderr, logbuf)
}
@@ -317,6 +327,8 @@ func TestFSSize(t *testing.T) {
}
if t.Failed() {
// Wait for handler to finish logging
time.Sleep(2 * time.Second)
// Dump buffered log data if there was a failure
io.Copy(os.Stderr, logbuf)
}