-
Notifications
You must be signed in to change notification settings - Fork 2
/
main_test.go
43 lines (33 loc) · 935 Bytes
/
main_test.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
36
37
38
39
40
41
42
43
package main
import (
"testing"
"github.com/rancher/go-rancher/client"
)
func Test_basic(t *testing.T) {
_ = &ServiceUpdater{
Config: &Config{
EnableLabel: "autoupdate.enable",
EnvironmentNames: []string{".*"},
Port: 8080,
},
service: &mockService{},
account: &mockAccount{},
}
}
type mockService struct{}
type mockAccount struct{}
func (a *mockService) ById(id string) (*client.Service, error) {
return nil, nil
}
func (a *mockService) List(opts *client.ListOpts) (*client.ServiceCollection, error) {
return nil, nil
}
func (a *mockService) ActionFinishupgrade(service *client.Service) (*client.Service, error) {
return nil, nil
}
func (a *mockService) ActionUpgrade(service *client.Service, serviceUpgrade *client.ServiceUpgrade) (*client.Service, error) {
return nil, nil
}
func (a *mockAccount) List(opts *client.ListOpts) (*client.AccountCollection, error) {
return nil, nil
}