builder/digitalocean: fix unit tests

This commit is contained in:
Mitchell Hashimoto 2015-06-10 14:28:05 -07:00
parent 9a393a5601
commit 311c9eb5c2
1 changed files with 3 additions and 13 deletions

View File

@ -1,22 +1,15 @@
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)