Commit 311c9eb5 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/digitalocean: fix unit tests

parent 9a393a56
package digitalocean
import (
"github.com/mitchellh/packer/packer"
"os"
"strconv"
"testing"
)
func init() {
// Clear out the credential env vars
os.Setenv("DIGITALOCEAN_API_KEY", "")
os.Setenv("DIGITALOCEAN_CLIENT_ID", "")
}
"github.com/mitchellh/packer/packer"
)
func testConfig() map[string]interface{} {
return map[string]interface{}{
"client_id": "foo",
"api_key": "bar",
"api_token": "bar",
}
}
......@@ -78,7 +71,6 @@ func TestBuilderPrepare_Region(t *testing.T) {
expected := "sfo1"
// Test set
config["region_id"] = 0
config["region"] = expected
b = Builder{}
warnings, err = b.Prepare(config)
......@@ -114,7 +106,6 @@ func TestBuilderPrepare_Size(t *testing.T) {
expected := "1024mb"
// Test set
config["size_id"] = 0
config["size"] = expected
b = Builder{}
warnings, err = b.Prepare(config)
......@@ -150,7 +141,6 @@ func TestBuilderPrepare_Image(t *testing.T) {
expected := "ubuntu-14-04-x64"
// Test set
config["image_id"] = 0
config["image"] = expected
b = Builder{}
warnings, err = b.Prepare(config)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment