summaryrefslogtreecommitdiff
path: root/libvirt/network_def_test.go
diff options
context:
space:
mode:
authorFlavio Castelli <fcastelli@suse.com>2017-03-02 23:06:24 +0100
committerAlvaro <alvaro.saurin@gmail.com>2017-03-03 09:50:04 +0100
commit01d6e3972e69e1158fba260b97f47921b3d7a4c4 (patch)
tree1df6c1d88c741801eb8295e1ec02bc8c151f1145 /libvirt/network_def_test.go
parentdea5495901aa84488b7b446a6708aeccf00c680a (diff)
downloadterraform-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/network_def_test.go')
-rw-r--r--libvirt/network_def_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/libvirt/network_def_test.go b/libvirt/network_def_test.go
index cd2048c7..d84c3ce8 100644
--- a/libvirt/network_def_test.go
+++ b/libvirt/network_def_test.go
@@ -91,3 +91,15 @@ func TestNetworkDefUnmarshall(t *testing.T) {
t.Logf("Marshalled:\n%s", bs)
}
}
+
+func TestBrokenNetworkDefUnmarshall(t *testing.T) {
+ // Try unmarshalling some broken xml
+ text := `
+ <network>
+ `
+
+ _, err := newDefNetworkFromXML(text)
+ if err == nil {
+ t.Error("Unmarshal was supposed to fail")
+ }
+}