func TestGetSwitchTypes(t *testing.T) { var ( c *ov.OVClient ) if os.Getenv("ONEVIEW_TEST_ACCEPTANCE") == "true" { _, c = getTestDriverA("test_switch_type") if c == nil { t.Fatalf("Failed to execute getTestDriver() ") } switchTypes, err := c.GetSwitchTypes("", "") assert.NoError(t, err, "GetSwitchTypes threw error -> %s, %+v\n", err, switchTypes) switchTypes, err = c.GetSwitchTypes("", "name:asc") assert.NoError(t, err, "GetSwitchTypes name:asc error -> %s, %+v\n", err, switchTypes) } else { _, c = getTestDriverU("test_switch_type") data, err := c.GetSwitchTypes("", "") assert.Error(t, err, fmt.Sprintf("ALL ok, no error, caught as expected: %s,%+v\n", err, data)) } }