123456789101112131415161718192021222324252627282930313233343536 |
- 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))
- }
- }
- }
|