Reverted previously removed additions of tests that check for ftp:// or nonexistent-protocol:// using DownloadableURL. DownloadableURL's responsibility is not to have inherent knowledge of protocols that are available, but to format an invalid url/path to a valid url/path.
This commit is contained in:
parent
46a5ca30e5
commit
3cf448f6ec
|
@ -76,17 +76,6 @@ func TestNewConfig_sourcePath(t *testing.T) {
|
|||
t.Fatalf("Nonexistant file should throw a validation error!")
|
||||
}
|
||||
|
||||
// Bad
|
||||
c = testConfig(t)
|
||||
c["source_path"] = "nonexistent-protocol://i/dont/exist"
|
||||
_, warns, err = NewConfig(c)
|
||||
if len(warns) > 0 {
|
||||
t.Fatalf("bad: %#v", warns)
|
||||
}
|
||||
if err == nil {
|
||||
t.Fatalf("should error")
|
||||
}
|
||||
|
||||
// Good
|
||||
tf := getTempFile(t)
|
||||
defer os.Remove(tf.Name())
|
||||
|
|
|
@ -43,12 +43,6 @@ func TestDownloadableURL(t *testing.T) {
|
|||
t.Fatalf("expected err : %s", err)
|
||||
}
|
||||
|
||||
// Invalid: unsupported scheme
|
||||
_, err = DownloadableURL("nonexistent-protocol://host.com/path")
|
||||
if err == nil {
|
||||
t.Fatalf("expected err : %s", err)
|
||||
}
|
||||
|
||||
// Valid: http
|
||||
u, err := DownloadableURL("HTTP://packer.io/path")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue