Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
pkg/platform/baremetal: add test for createTerraformConfigFile
Browse files Browse the repository at this point in the history
So the template syntax is checked by unit tests.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
  • Loading branch information
invidian committed May 28, 2020
1 parent 15be275 commit 9545489
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pkg/platform/baremetal/baremetal_internal_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package baremetal

import (
"io/ioutil"
"os"
"testing"
)

// createTerraformConfigFile() test.
func TestCreateTerraformConfigFile(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "lokoctl-tests-")
if err != nil {
t.Fatalf("creating tmp dir should succeed, got: %v", err)
}

t.Cleanup(func() {
if err := os.RemoveAll(tmpDir); err != nil {
t.Logf("failed to remove temp dir %q: %v", tmpDir, err)
}
})

c := &config{}

if err := createTerraformConfigFile(c, tmpDir); err != nil {
t.Fatalf("creating Terraform config files should succeed, got: %v", err)
}
}

0 comments on commit 9545489

Please sign in to comment.