Skip to content

Commit 4263d58

Browse files
test: cover agent tasks list options error
1 parent efa12d7 commit 4263d58

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

github/agent_tasks.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ func (s *AgentTasksService) GetByRepo(ctx context.Context, owner, repo, taskID s
186186
//
187187
//meta:operation GET /agents/tasks
188188
func (s *AgentTasksService) List(ctx context.Context, opts *AgentTaskListOptions) (*AgentTaskList, *Response, error) {
189-
u := "agents/tasks"
189+
return s.list(ctx, "agents/tasks", opts)
190+
}
191+
192+
func (s *AgentTasksService) list(ctx context.Context, u string, opts *AgentTaskListOptions) (*AgentTaskList, *Response, error) {
190193
u, err := addOptions(u, opts)
191194
if err != nil {
192195
return nil, nil, err

github/agent_tasks_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,15 @@ func TestAgentTasksService_List(t *testing.T) {
314314
})
315315
}
316316

317+
func TestAgentTasksService_List_badOptions(t *testing.T) {
318+
t.Parallel()
319+
client, _, _ := setup(t)
320+
321+
ctx := t.Context()
322+
_, _, err := client.AgentTasks.list(ctx, "%", &AgentTaskListOptions{})
323+
testURLParseError(t, err)
324+
}
325+
317326
func TestAgentTasksService_Get(t *testing.T) {
318327
t.Parallel()
319328
client, mux, _ := setup(t)

0 commit comments

Comments
 (0)