Example #1
0
func TestUnlockResponseWithLock(t *testing.T) {
	schema.Validate(t, schema.UnlockResponseSchema, &api.UnlockResponse{
		Lock: &api.Lock{
			Id: "some-lock-id",
		},
	})
}
Example #2
0
func TestLockListWithLocks(t *testing.T) {
	schema.Validate(t, schema.LockListSchema, &api.LockList{
		Locks: []api.Lock{
			api.Lock{Id: "foo"},
			api.Lock{Id: "bar"},
		},
	})
}
Example #3
0
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",
	})
}
Example #4
0
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: "*****@*****.**",
		},
	})
}
Example #5
0
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(),
		},
	})
}
Example #6
0
func TestLockListWithError(t *testing.T) {
	schema.Validate(t, schema.LockListSchema, &api.LockList{
		Err: "some error",
	})
}
Example #7
0
func TestLockListWithNoResults(t *testing.T) {
	schema.Validate(t, schema.LockListSchema, &api.LockList{
		Locks: []api.Lock{},
	})
}
Example #8
0
func TestUnlockResponseWithError(t *testing.T) {
	schema.Validate(t, schema.UnlockResponseSchema, &api.UnlockResponse{
		Err: "some-error",
	})
}
Example #9
0
func TestUnlockRequest(t *testing.T) {
	schema.Validate(t, schema.UnlockRequestSchema, &api.UnlockRequest{
		Id:    "some-lock-id",
		Force: false,
	})
}
Example #10
0
func TestLockResponseWithCommitNeeded(t *testing.T) {
	schema.Validate(t, schema.LockResponseSchema, &api.LockResponse{
		CommitNeeded: "deadbeef",
	})
}