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