diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-02-05 02:43:57 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-02-05 06:47:16 +0300 |
commit | 89b0aa23f7ee209038ca4db52357c1673c234d68 (patch) | |
tree | 5ac8ec275c7fa24dccf5ae0858136b9feb0d568e /internal/httpfs/http_fs_test.go | |
parent | 754454c5ca27893406d5b1d329395bf4f633dc2b (diff) |
Make NewFileSystemPath return error
Diffstat (limited to 'internal/httpfs/http_fs_test.go')
-rw-r--r-- | internal/httpfs/http_fs_test.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/httpfs/http_fs_test.go b/internal/httpfs/http_fs_test.go index b8606d9d..3d1092b6 100644 --- a/internal/httpfs/http_fs_test.go +++ b/internal/httpfs/http_fs_test.go @@ -62,7 +62,8 @@ func TestFSOpen(t *testing.T) { for name, test := range tests { t.Run(name, func(t *testing.T) { - p := NewFileSystemPath(test.allowedPaths) + p, err := NewFileSystemPath(test.allowedPaths) + require.NoError(t, err) got, err := p.Open(test.fileName) if test.expectedErrMsg != "" { @@ -140,7 +141,10 @@ func TestFileSystemPathCanServeHTTP(t *testing.T) { for name, test := range tests { t.Run(name, func(t *testing.T) { transport := httptransport.NewTransport() - transport.RegisterProtocol("file", http.NewFileTransport(NewFileSystemPath([]string{test.path}))) + fs, err := NewFileSystemPath([]string{test.path}) + require.NoError(t, err) + + transport.RegisterProtocol("file", http.NewFileTransport(fs)) client := &http.Client{ Transport: transport, |