mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 14:54:01 +03:00
Add fetching of addresses from proxyGetConfig endpoint
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package dc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
type LoggerMock struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
func (m *LoggerMock) Info(msg string) {
|
||||
m.Called(msg)
|
||||
}
|
||||
|
||||
func (m *LoggerMock) WarningError(msg string, err error) {
|
||||
m.Called(msg, err)
|
||||
}
|
||||
|
||||
type UpdaterTestSuiteBase struct {
|
||||
suite.Suite
|
||||
|
||||
ctx context.Context
|
||||
ctxCancel context.CancelFunc
|
||||
loggerMock *LoggerMock
|
||||
}
|
||||
|
||||
func (s *UpdaterTestSuiteBase) SetupTest() {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
s.loggerMock = &LoggerMock{}
|
||||
s.loggerMock.On("Info", mock.AnythingOfType("string"))
|
||||
s.loggerMock.On("WarningError", mock.AnythingOfType("string"), mock.Anything)
|
||||
|
||||
s.ctx = ctx
|
||||
s.ctxCancel = cancel
|
||||
}
|
||||
|
||||
func (s *UpdaterTestSuiteBase) TearDownTest() {
|
||||
s.ctxCancel()
|
||||
}
|
||||
Reference in New Issue
Block a user