func TestUnlockResponseWithLock(t *testing.T) { schema.Validate(t, schema.UnlockResponseSchema, &api.UnlockResponse{ Lock: &api.Lock{ Id: "some-lock-id", }, }) }
func TestLockListWithLocks(t *testing.T) { schema.Validate(t, schema.LockListSchema, &api.LockList{ Locks: []api.Lock{ api.Lock{Id: "foo"}, api.Lock{Id: "bar"}, }, }) }
func TestLockListWithNextCursor(t *testing.T) { schema.Validate(t, schema.LockListSchema, &api.LockList{ Locks: []api.Lock{ api.Lock{Id: "foo"}, api.Lock{Id: "bar"}, }, NextCursor: "baz", }) }
func TestLockRequest(t *testing.T) { schema.Validate(t, schema.LockRequestSchema, &api.LockRequest{ Path: "/path/to/lock", LatestRemoteCommit: "deadbeef", Committer: api.Committer{ Name: "Jane Doe", Email: "*****@*****.**", }, }) }
func TestLockResponseWithLockedLock(t *testing.T) { schema.Validate(t, schema.LockResponseSchema, &api.LockResponse{ Lock: &api.Lock{ Id: "some-lock-id", Path: "/lock/path", Committer: api.Committer{ Name: "Jane Doe", Email: "*****@*****.**", }, LockedAt: time.Now(), }, }) }
func TestLockListWithError(t *testing.T) { schema.Validate(t, schema.LockListSchema, &api.LockList{ Err: "some error", }) }
func TestLockListWithNoResults(t *testing.T) { schema.Validate(t, schema.LockListSchema, &api.LockList{ Locks: []api.Lock{}, }) }
func TestUnlockResponseWithError(t *testing.T) { schema.Validate(t, schema.UnlockResponseSchema, &api.UnlockResponse{ Err: "some-error", }) }
func TestUnlockRequest(t *testing.T) { schema.Validate(t, schema.UnlockRequestSchema, &api.UnlockRequest{ Id: "some-lock-id", Force: false, }) }
func TestLockResponseWithCommitNeeded(t *testing.T) { schema.Validate(t, schema.LockResponseSchema, &api.LockResponse{ CommitNeeded: "deadbeef", }) }