forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_projectrequests.go
35 lines (27 loc) · 1.11 KB
/
fake_projectrequests.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package testclient
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
clientgotesting "k8s.io/client-go/testing"
projectapi "github.com/openshift/origin/pkg/project/apis/project"
)
// FakeProjectRequests implements ProjectInterface. Meant to be embedded into a struct to get a default
// implementation. This makes faking out just the methods you want to test easier.
type FakeProjectRequests struct {
Fake *Fake
}
var newProjectsResource = schema.GroupVersionResource{Group: "", Version: "", Resource: "newprojects"}
func (c *FakeProjectRequests) List(opts metav1.ListOptions) (*metav1.Status, error) {
obj, err := c.Fake.Invokes(clientgotesting.NewRootListAction(newProjectsResource, opts), &metav1.Status{})
if obj == nil {
return nil, err
}
return obj.(*metav1.Status), err
}
func (c *FakeProjectRequests) Create(inObj *projectapi.ProjectRequest) (*projectapi.Project, error) {
obj, err := c.Fake.Invokes(clientgotesting.NewRootCreateAction(newProjectsResource, inObj), &projectapi.Project{})
if obj == nil {
return nil, err
}
return obj.(*projectapi.Project), err
}