Example #1
0
func TestCreateRegistryError(t *testing.T) {
	fakeEtcdClient, helper := newHelper(t)
	fakeEtcdClient.Err = fmt.Errorf("test error")
	storage := NewStorage(helper, nil).Pod

	pod := validNewPod()
	_, err := storage.Create(api.NewDefaultContext(), pod)
	if !errors.IsInternalServerError(err) {
		t.Fatalf("unexpected error: %v", err)
	}
}
Example #2
0
func TestCreateRegistryError(t *testing.T) {
	fakeEtcdClient, helper := newHelper(t)
	fakeEtcdClient.Err = fmt.Errorf("test error")
	storage, _ := NewStorage(helper)

	resourcequota := validNewResourceQuota()
	_, err := storage.Create(api.NewDefaultContext(), resourcequota)
	if !errors.IsInternalServerError(err) {
		t.Fatalf("unexpected error: %v", err)
	}
}