Skip to content

Commit cc33da1

Browse files
committed
fixup tests
1 parent 0cdd5a3 commit cc33da1

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

api/api_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func TestAPI(t *testing.T) {
171171
Response: "foobar",
172172
},
173173
{
174-
Name: "FileAPI",
174+
Name: "FileAPINotExists",
175175
Path: "/files/nonexistent",
176176
Status: http.StatusNotFound,
177177
},

storage/storage_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ func TestNewStorage(t *testing.T) {
104104
require.Error(t, err)
105105
require.Regexp(t, test.error, err.Error())
106106
} else if test.local {
107-
_, ok := s.(*storage.Local)
107+
under := s.(*storage.Signature)
108+
_, ok := under.Storage.(*storage.Local)
108109
require.True(t, ok)
109110
require.NoError(t, err)
110111
} else {
111-
_, ok := s.(*storage.Artifactory)
112+
under := s.(*storage.Signature)
113+
_, ok := under.Storage.(*storage.Artifactory)
112114
require.True(t, ok)
113115
require.NoError(t, err)
114116
}

testutil/mockstorage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (s *MockStorage) AddExtension(ctx context.Context, manifest *storage.VSIXMa
2727
return "", errors.New("not implemented")
2828
}
2929
func (s *MockStorage) Open(ctx context.Context, path string) (fs.File, error) {
30-
if filepath.Base(path) == "/nonexistent" {
30+
if filepath.Base(path) == "nonexistent" {
3131
return nil, fs.ErrNotExist
3232
}
3333

0 commit comments

Comments
 (0)