Modified common/download_test.go to not test the smb:// uri on platforms other than windows. Added an immediate platform error to SMBDownloader.Download as opposed to letting .toPath return it (which would have left the structure partially initialized).
This commit is contained in:
parent
4783b6508e
commit
5a4ce2165c
|
@ -637,6 +637,12 @@ func (d *SMBDownloader) toPath(base string, uri url.URL) (string, error) {
|
|||
}
|
||||
|
||||
func (d *SMBDownloader) Download(dst *os.File, src *url.URL) error {
|
||||
|
||||
/* first we warn the world if we're not running windows */
|
||||
if runtime.GOOS != "windows" {
|
||||
return fmt.Errorf("Support for SMB based uri's are not supported on %s", runtime.GOOS)
|
||||
}
|
||||
|
||||
d.active = false
|
||||
|
||||
/* convert the uri using the net/url module to a UNC path */
|
||||
|
|
|
@ -483,6 +483,9 @@ func TestFileUriTransforms(t *testing.T) {
|
|||
t.Logf("TestFileUriTransforms : Result Path '%s'", res)
|
||||
}
|
||||
|
||||
// smb protocol depends on platform support which currently
|
||||
// only exists on windows.
|
||||
if runtime.GOOS == "windows" {
|
||||
// ...and finally the oddball windows native path
|
||||
// smb://host/sharename/file -> \\host\sharename\file
|
||||
testcase := host + "/" + share + "/" + cwd[1:] + "/%s"
|
||||
|
@ -494,4 +497,5 @@ func TestFileUriTransforms(t *testing.T) {
|
|||
return
|
||||
}
|
||||
t.Logf("TestFileUriTransforms : Result Path '%s'", res)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue