1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 10:07:02 +00:00

datastore: Concurrency fix, closes #77

This commit is contained in:
James Hillyerd
2018-03-09 14:02:15 -08:00
parent a89b6bbca2
commit a3877e4f4b
6 changed files with 111 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package datastore
import (
"io"
"net/mail"
"sync"
"time"
"github.com/jhillyerd/enmime"
@@ -26,6 +27,10 @@ func (m *MockDataStore) AllMailboxes() ([]Mailbox, error) {
return args.Get(0).([]Mailbox), args.Error(1)
}
func (m *MockDataStore) LockFor(name string) (*sync.RWMutex, error) {
return &sync.RWMutex{}, nil
}
// MockMailbox is a shared mock for unit testing
type MockMailbox struct {
mock.Mock