tusd/memorylocker/memorylocker_test.go

22 lines
389 B
Go
Raw Normal View History

package memorylocker
import (
"testing"
2016-01-20 15:40:13 +00:00
"github.com/stretchr/testify/assert"
"github.com/tus/tusd"
)
func TestMemoryLocker(t *testing.T) {
2016-01-20 15:40:13 +00:00
a := assert.New(t)
var locker tusd.LockerDataStore
2016-02-21 22:25:35 +00:00
locker = New()
2016-01-20 15:40:13 +00:00
a.NoError(locker.LockUpload("one"))
a.Equal(tusd.ErrFileLocked, locker.LockUpload("one"))
a.NoError(locker.UnlockUpload("one"))
a.NoError(locker.UnlockUpload("one"))
}