1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

storage: Message refactoring for #69

- Message interface renamed to StoreMessage
- Message.Delete becomes Store.RemoveMessage
- Added deleted message tracking to Store stub for #80
This commit is contained in:
James Hillyerd
2018-03-11 15:01:40 -07:00
parent 12ad0cb3f0
commit 487e491d6f
11 changed files with 190 additions and 118 deletions

View File

@@ -16,6 +16,7 @@ import (
"github.com/jhillyerd/inbucket/pkg/config"
"github.com/jhillyerd/inbucket/pkg/msghub"
"github.com/jhillyerd/inbucket/pkg/storage"
"github.com/jhillyerd/inbucket/pkg/test"
)
type scriptStep struct {
@@ -25,10 +26,8 @@ type scriptStep struct {
// Test commands in GREET state
func TestGreetState(t *testing.T) {
// Setup mock objects
mds := &storage.MockDataStore{}
server, logbuf, teardown := setupSMTPServer(mds)
ds := test.NewStore()
server, logbuf, teardown := setupSMTPServer(ds)
defer teardown()
// Test out some mangled HELOs
@@ -82,10 +81,8 @@ func TestGreetState(t *testing.T) {
// Test commands in READY state
func TestReadyState(t *testing.T) {
// Setup mock objects
mds := &storage.MockDataStore{}
server, logbuf, teardown := setupSMTPServer(mds)
ds := test.NewStore()
server, logbuf, teardown := setupSMTPServer(ds)
defer teardown()
// Test out some mangled READY commands