Skip to content

Commit 11ea4e2

Browse files
committed
Remove test that can panic
1 parent d4a0764 commit 11ea4e2

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

pkg/github/repository_resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ func RepositoryResourceContentsHandler(getClient GetClientFn) func(ctx context.C
201201
}
202202
}
203203

204+
// This should be unreachable because GetContents should return an error if neither file nor directory content is found.
204205
return nil, errors.New("no repository resource content found")
205206
}
206207
}

pkg/github/repository_resource_test.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -180,21 +180,6 @@ func Test_repositoryResourceContentsHandler(t *testing.T) {
180180
},
181181
expectedResult: expectedDirContent,
182182
},
183-
{
184-
name: "no data",
185-
mockedClient: mock.NewMockedHTTPClient(
186-
mock.WithRequestMatch(
187-
mock.GetReposContentsByOwnerByRepoByPath,
188-
),
189-
),
190-
requestArgs: map[string]any{
191-
"owner": []string{"owner"},
192-
"repo": []string{"repo"},
193-
"path": []string{"src"},
194-
},
195-
expectedResult: nil,
196-
expectError: "no repository resource content found",
197-
},
198183
{
199184
name: "empty data",
200185
mockedClient: mock.NewMockedHTTPClient(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy