Пример #1
0
func TestGetServices(t *testing.T) {
	if skip {
		t.SkipNow()
	}
	services, err := balance.GetServices()
	if err != nil {
		t.Errorf("Failed to GET services - %v", err)
		t.FailNow()
	}

	if services[0].Id != testService2.Id {
		t.Errorf("Read service differs from written service")
	}
}
Пример #2
0
func TestGetServicesNginx(t *testing.T) {
	if !nginxPrep() {
		t.SkipNow()
	}

	if err := balance.SetServices([]core.Service{testService2}); err != nil {
		t.Errorf("Failed to SET services - %v", err)
		t.FailNow()
	}

	services, err := balance.GetServices()
	if err != nil {
		t.Errorf("Failed to GET services - %v", err)
		t.FailNow()
	}

	if services[0].Id != testService2.Id {
		t.Errorf("Read service differs from written service")
	}
}