forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfake_projectrequests.go
33 lines (26 loc) · 1.01 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
package testclient
import (
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
ktestclient "k8s.io/kubernetes/pkg/client/unversioned/testclient"
projectapi "github.com/openshift/origin/pkg/project/api"
)
// 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
}
func (c *FakeProjectRequests) List(opts kapi.ListOptions) (*unversioned.Status, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootListAction("newprojects", opts), &unversioned.Status{})
if obj == nil {
return nil, err
}
return obj.(*unversioned.Status), err
}
func (c *FakeProjectRequests) Create(inObj *projectapi.ProjectRequest) (*projectapi.Project, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootCreateAction("newprojects", inObj), &projectapi.Project{})
if obj == nil {
return nil, err
}
return obj.(*projectapi.Project), err
}