probo/store/file/participant_test.go

36 lines
608 B
Go

package file
import (
"os"
"git.andreafazzi.eu/andrea/probo/models"
"github.com/remogatto/prettytest"
)
type participantTestSuite struct {
prettytest.Suite
}
func (t *participantTestSuite) TestCreate() {
pStore, err := NewParticipantDefaultFileStore()
t.Nil(err)
if !t.Failed() {
p, err := pStore.Create(&models.Participant{
Lastname: "Doe",
Firstname: "John",
Attributes: map[string]string{"class": "1 D LIN"},
})
t.Nil(err)
defer os.Remove(pStore.GetPath(p))
if !t.Failed() {
exists, err := os.Stat(pStore.GetPath(p))
t.Nil(err)
t.Not(t.Nil(exists))
}
}
}