Add an acceptance test for driver.Host
This commit is contained in:
parent
23c6951aa4
commit
3cb2185c53
21
driver/testing/host_acc_test.go
Normal file
21
driver/testing/host_acc_test.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package testing
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestHostAcc(t *testing.T) {
|
||||||
|
initDriverAcceptanceTest(t)
|
||||||
|
|
||||||
|
d := NewTestDriver(t)
|
||||||
|
host, err := d.FindHost(TestHost)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Cannot find the default datastore '%v': %v", TestDatastore, err)
|
||||||
|
}
|
||||||
|
switch info, err := host.Info("name"); {
|
||||||
|
case err != nil:
|
||||||
|
t.Errorf("Cannot read datastore properties: %v", err)
|
||||||
|
case info.Name != TestHost:
|
||||||
|
t.Errorf("Wrong datastore. expected: %v, got: %v", TestHost, info.Name)
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user