Example #1
0
func TestUnlockResponseDoesNotAllowLockAndError(t *testing.T) {
	schema.Refute(t, schema.UnlockResponseSchema, &api.UnlockResponse{
		Lock: &api.Lock{
			Id: "some-lock-id",
		},
		Err: "some-error",
	})
}
Example #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!",
	})
}
Example #3
0
func TestLockResponseInvalidWithCommitAndError(t *testing.T) {
	schema.Refute(t, schema.LockResponseSchema, &api.LockResponse{
		Err:          "some error",
		CommitNeeded: "deadbeef",
	})
}