示例#1
0
func TestUnlockResponseDoesNotAllowLockAndError(t *testing.T) {
	schema.Refute(t, schema.UnlockResponseSchema, &api.UnlockResponse{
		Lock: &api.Lock{
			Id: "some-lock-id",
		},
		Err: "some-error",
	})
}
示例#2
0
func TestLockListWithErrorAndLocks(t *testing.T) {
	schema.Refute(t, schema.LockListSchema, &api.LockList{
		Locks: []api.Lock{
			api.Lock{Id: "foo"},
			api.Lock{Id: "bar"},
		},
		Err: "this isn't possible!",
	})
}
示例#3
0
func TestLockResponseInvalidWithCommitAndError(t *testing.T) {
	schema.Refute(t, schema.LockResponseSchema, &api.LockResponse{
		Err:          "some error",
		CommitNeeded: "deadbeef",
	})
}