diff options
author | Flavio Castelli <fcastelli@suse.com> | 2017-03-02 23:06:24 +0100 |
---|---|---|
committer | Alvaro <alvaro.saurin@gmail.com> | 2017-03-03 09:50:04 +0100 |
commit | 01d6e3972e69e1158fba260b97f47921b3d7a4c4 (patch) | |
tree | 1df6c1d88c741801eb8295e1ec02bc8c151f1145 /libvirt/resource_libvirt_domain_test.go | |
parent | dea5495901aa84488b7b446a6708aeccf00c680a (diff) | |
download | terraform-provider-libvirt-01d6e3972e69e1158fba260b97f47921b3d7a4c4.tar terraform-provider-libvirt-01d6e3972e69e1158fba260b97f47921b3d7a4c4.tar.gz |
Improve code coverage
Improve code coverage results by writing some unit tests.
These are really the low hanging fruits, more should come later.
Signed-off-by: Flavio Castelli <fcastelli@suse.com>
Diffstat (limited to 'libvirt/resource_libvirt_domain_test.go')
-rw-r--r-- | libvirt/resource_libvirt_domain_test.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libvirt/resource_libvirt_domain_test.go b/libvirt/resource_libvirt_domain_test.go index 6749283c..749f5e17 100644 --- a/libvirt/resource_libvirt_domain_test.go +++ b/libvirt/resource_libvirt_domain_test.go @@ -236,7 +236,7 @@ func TestAccLibvirtDomain_IgnitionObject(t *testing.T) { CheckDestroy: testAccCheckLibvirtDomainDestroy, Steps: []resource.TestStep{ resource.TestStep{ - Config: config, + Config: config, ExpectNonEmptyPlan: true, Check: resource.ComposeTestCheckFunc( testAccCheckLibvirtDomainExists("libvirt_domain.acceptance-test-domain", &domain), @@ -337,3 +337,12 @@ func testAccCheckIgnitionFileNameExists(domain *libvirt.VirDomain) resource.Test return nil } } + +func TestHash(t *testing.T) { + actual := hash("this is a test") + expected := "2e99758548972a8e8822ad47fa1017ff72f06f3ff6a016851f45c398732bc50c" + + if actual != expected { + t.Errorf("Expected %s, got %s", expected, actual) + } +} |