Add an acceptance test for `driver.Host`

This commit is contained in:
Andrey Tonkikh 2017-10-26 01:07:25 +03:00
parent 23c6951aa4
commit 3cb2185c53
1 changed files with 21 additions and 0 deletions

View 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)
}
}