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

builder/digitalocean: fix unit tests

parent 9a393a56
package digitalocean package digitalocean
import ( import (
"github.com/mitchellh/packer/packer"
"os"
"strconv" "strconv"
"testing" "testing"
)
func init() { "github.com/mitchellh/packer/packer"
// Clear out the credential env vars )
os.Setenv("DIGITALOCEAN_API_KEY", "")
os.Setenv("DIGITALOCEAN_CLIENT_ID", "")
}
func testConfig() map[string]interface{} { func testConfig() map[string]interface{} {
return map[string]interface{}{ return map[string]interface{}{
"client_id": "foo", "api_token": "bar",
"api_key": "bar",
} }
} }
...@@ -78,7 +71,6 @@ func TestBuilderPrepare_Region(t *testing.T) { ...@@ -78,7 +71,6 @@ func TestBuilderPrepare_Region(t *testing.T) {
expected := "sfo1" expected := "sfo1"
// Test set // Test set
config["region_id"] = 0
config["region"] = expected config["region"] = expected
b = Builder{} b = Builder{}
warnings, err = b.Prepare(config) warnings, err = b.Prepare(config)
...@@ -114,7 +106,6 @@ func TestBuilderPrepare_Size(t *testing.T) { ...@@ -114,7 +106,6 @@ func TestBuilderPrepare_Size(t *testing.T) {
expected := "1024mb" expected := "1024mb"
// Test set // Test set
config["size_id"] = 0
config["size"] = expected config["size"] = expected
b = Builder{} b = Builder{}
warnings, err = b.Prepare(config) warnings, err = b.Prepare(config)
...@@ -150,7 +141,6 @@ func TestBuilderPrepare_Image(t *testing.T) { ...@@ -150,7 +141,6 @@ func TestBuilderPrepare_Image(t *testing.T) {
expected := "ubuntu-14-04-x64" expected := "ubuntu-14-04-x64"
// Test set // Test set
config["image_id"] = 0
config["image"] = expected config["image"] = expected
b = Builder{} b = Builder{}
warnings, err = b.Prepare(config) 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