Added missing login and logout method to client interface, updated mocks

This commit is contained in:
Adphi 2019-01-16 16:25:20 +01:00
parent dd062fe989
commit 2953afd160
2 changed files with 119 additions and 10 deletions

View File

@ -9,6 +9,8 @@ type Client interface {
Shares() Shares Shares() Shares
Users() Users Users() Users
Groups() Groups Groups() Groups
Login(username string, password string) error
Logout() error
} }
type Auth interface { type Auth interface {

View File

@ -1,44 +1,151 @@
// Code generated by mockery v1.0.0. DO NOT EDIT.
package mocks package mocks
import ( import mock "github.com/stretchr/testify/mock"
"gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud/types" import types "gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud/types"
)
// Client is an autogenerated mock type for the Client type // Client is an autogenerated mock type for the Client type
type Client struct { type Client struct {
mock.Mock
} }
// Apps provides a mock function with given fields: // Apps provides a mock function with given fields:
func (_m *Client) Apps() types.Apps { func (_m *Client) Apps() types.Apps {
return new(Apps) ret := _m.Called()
var r0 types.Apps
if rf, ok := ret.Get(0).(func() types.Apps); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Apps)
}
}
return r0
} }
// AppsConfig provides a mock function with given fields: // AppsConfig provides a mock function with given fields:
func (_m *Client) AppsConfig() types.AppsConfig { func (_m *Client) AppsConfig() types.AppsConfig {
return new(AppsConfig) ret := _m.Called()
var r0 types.AppsConfig
if rf, ok := ret.Get(0).(func() types.AppsConfig); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.AppsConfig)
}
}
return r0
} }
// GroupFolders provides a mock function with given fields: // GroupFolders provides a mock function with given fields:
func (_m *Client) GroupFolders() types.GroupFolders { func (_m *Client) GroupFolders() types.GroupFolders {
return new(GroupFolders) ret := _m.Called()
var r0 types.GroupFolders
if rf, ok := ret.Get(0).(func() types.GroupFolders); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.GroupFolders)
}
}
return r0
} }
// Groups provides a mock function with given fields: // Groups provides a mock function with given fields:
func (_m *Client) Groups() types.Groups { func (_m *Client) Groups() types.Groups {
return new(Groups) ret := _m.Called()
var r0 types.Groups
if rf, ok := ret.Get(0).(func() types.Groups); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Groups)
}
}
return r0
}
// Login provides a mock function with given fields: username, password
func (_m *Client) Login(username string, password string) error {
ret := _m.Called(username, password)
var r0 error
if rf, ok := ret.Get(0).(func(string, string) error); ok {
r0 = rf(username, password)
} else {
r0 = ret.Error(0)
}
return r0
}
// Logout provides a mock function with given fields:
func (_m *Client) Logout() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
} }
// Notifications provides a mock function with given fields: // Notifications provides a mock function with given fields:
func (_m *Client) Notifications() types.Notifications { func (_m *Client) Notifications() types.Notifications {
return new(Notifications) ret := _m.Called()
var r0 types.Notifications
if rf, ok := ret.Get(0).(func() types.Notifications); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Notifications)
}
}
return r0
} }
// Shares provides a mock function with given fields: // Shares provides a mock function with given fields:
func (_m *Client) Shares() types.Shares { func (_m *Client) Shares() types.Shares {
return new(Shares) ret := _m.Called()
var r0 types.Shares
if rf, ok := ret.Get(0).(func() types.Shares); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Shares)
}
}
return r0
} }
// Users provides a mock function with given fields: // Users provides a mock function with given fields:
func (_m *Client) Users() types.Users { func (_m *Client) Users() types.Users {
return new(Users) ret := _m.Called()
var r0 types.Users
if rf, ok := ret.Get(0).(func() types.Users); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(types.Users)
}
}
return r0
} }