Correct some error messages in tests

This commit is contained in:
Andrey Tonkikh 2017-10-26 19:15:54 +03:00
parent 3cb2185c53
commit c41ee01537
2 changed files with 8 additions and 8 deletions

View File

@ -10,12 +10,12 @@ func TestHostAcc(t *testing.T) {
d := NewTestDriver(t)
host, err := d.FindHost(TestHost)
if err != nil {
t.Fatalf("Cannot find the default datastore '%v': %v", TestDatastore, err)
t.Fatalf("Cannot find the default host '%v': %v", TestDatastore, err)
}
switch info, err := host.Info("name"); {
case err != nil:
t.Errorf("Cannot read datastore properties: %v", err)
t.Errorf("Cannot read host properties: %v", err)
case info.Name != TestHost:
t.Errorf("Wrong datastore. expected: %v, got: %v", TestHost, info.Name)
t.Errorf("Wrong host name: expected '%v', got: '%v'", TestHost, info.Name)
}
}

View File

@ -32,25 +32,25 @@ func CheckDatastoreName(t *testing.T, ds *driver.Datastore, datastore string) {
case err != nil:
t.Errorf("Cannot read datastore properties: %v", err)
case info.Name != datastore:
t.Errorf("Wrong datastore. expected: %v, got: %v", datastore, info.Name)
t.Errorf("Wrong name: expected '%v', got: '%v'", datastore, info.Name)
}
}
func CheckResourcePoolPath(t *testing.T, p *driver.ResourcePool, pool string) {
switch path, err := p.Path(); {
case err != nil:
t.Errorf("Cannot read resource pool name: %v", err)
t.Errorf("Cannot read resource pool path: %v", err)
case path != pool:
t.Errorf("Wrong folder. expected: %v, got: %v", pool, path)
t.Errorf("Wrong name: expected '%v', got: '%v'", pool, path)
}
}
func CheckFolderPath(t *testing.T, f *driver.Folder, folder string) {
switch path, err := f.Path(); {
case err != nil:
t.Fatalf("Cannot read folder name: %v", err)
t.Fatalf("Cannot read folder path: %v", err)
case path != folder:
t.Errorf("Wrong folder. expected: %v, got: %v", folder, path)
t.Errorf("Wrong path: expected '%v', got: '%v'", folder, path)
}
}