Maint: do not mock os functions
- Use filepaths with /tmp for tests instead - Only mock functions where filepath can't be specified such as user.Lookup
This commit is contained in:
@@ -5,19 +5,22 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/qdm12/golibs/logging"
|
||||
"github.com/qdm12/golibs/os"
|
||||
"github.com/qdm12/golibs/params"
|
||||
)
|
||||
|
||||
type CLI interface {
|
||||
ClientKey(args []string, openFile os.OpenFileFunc) error
|
||||
HealthCheck(ctx context.Context, env params.Env, os os.OS, logger logging.Logger) error
|
||||
OpenvpnConfig(os os.OS, logger logging.Logger) error
|
||||
Update(ctx context.Context, args []string, os os.OS, logger logging.Logger) error
|
||||
ClientKey(args []string) error
|
||||
HealthCheck(ctx context.Context, env params.Env, logger logging.Logger) error
|
||||
OpenvpnConfig(logger logging.Logger) error
|
||||
Update(ctx context.Context, args []string, logger logging.Logger) error
|
||||
}
|
||||
|
||||
type cli struct{}
|
||||
type cli struct {
|
||||
repoServersPath string
|
||||
}
|
||||
|
||||
func New() CLI {
|
||||
return &cli{}
|
||||
return &cli{
|
||||
repoServersPath: "./internal/constants/servers.json",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user