Adjust + Test
This commit is contained in:
@@ -16,10 +16,11 @@ type MockInstance struct {
|
||||
resources.ResourceInstance[*MockPartner]
|
||||
}
|
||||
|
||||
func (m *MockInstance) GetID() string { return m.ID }
|
||||
func (m *MockInstance) GetName() string { return m.Name }
|
||||
func (m *MockInstance) ClearEnv() {}
|
||||
func (m *MockInstance) ClearPeerGroups() {}
|
||||
func (m *MockInstance) GetID() string { return m.ID }
|
||||
func (m *MockInstance) GetName() string { return m.Name }
|
||||
func (m *MockInstance) ClearEnv() {}
|
||||
func (m *MockInstance) ClearPeerGroups() {}
|
||||
func (m *MockPartner) FilterPartnership(peerID string) {}
|
||||
func (m *MockInstance) GetProfile(peerID string, a *int, b *int, c *int) pricing.PricingProfileITF {
|
||||
return nil
|
||||
}
|
||||
@@ -36,10 +37,6 @@ type MockPartner struct {
|
||||
groups map[string][]string
|
||||
}
|
||||
|
||||
func (abs *MockPartner) RefineResourceByPartnership(peerID string) (resources.ResourcePartnerITF, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (m *MockPartner) GetProfile(buying *int, strategy *int) pricing.PricingProfileITF {
|
||||
return nil
|
||||
}
|
||||
@@ -48,6 +45,7 @@ func (m *MockPartner) GetPeerGroups() map[string][]string {
|
||||
return m.groups
|
||||
}
|
||||
func (m *MockPartner) ClearPeerGroups() {}
|
||||
|
||||
func (m *MockPartner) GetPricingsProfiles(string, []string) []pricing.PricingProfileITF {
|
||||
return nil
|
||||
}
|
||||
@@ -107,9 +105,9 @@ type FakeResource struct {
|
||||
resources.AbstractInstanciatedResource[*MockInstance]
|
||||
}
|
||||
|
||||
func (f *FakeResource) Trim() {}
|
||||
func (f *FakeResource) SetAllowedInstances(*tools.APIRequest) {}
|
||||
func (f *FakeResource) VerifyAuth(string, *tools.APIRequest) bool { return true }
|
||||
func (f *FakeResource) Trim() {}
|
||||
func (f *FakeResource) SetAllowedInstances(*tools.APIRequest, ...string) {}
|
||||
func (f *FakeResource) VerifyAuth(string, *tools.APIRequest) bool { return true }
|
||||
|
||||
func TestNewAccessor_ReturnsValid(t *testing.T) {
|
||||
acc := resources.NewAccessor[*FakeResource](tools.COMPUTE_RESOURCE, &tools.APIRequest{}, func() utils.DBObject {
|
||||
|
||||
Reference in New Issue
Block a user