fix tests

This commit is contained in:
crapStone 2023-11-19 23:56:56 +01:00
parent 5ed4ca2500
commit 7b3a09d8ac
No known key found for this signature in database
GPG Key ID: D74B82E7CDD863FE
2 changed files with 18 additions and 15 deletions

View File

@ -74,21 +74,19 @@ func TestReadConfigShouldReturnConfigFromFileWhenConfigArgPresent(t *testing.T)
runApp(
t,
func(ctx *cli.Context) error {
content, err := os.ReadFile("assets/test_config.toml")
if err != nil {
return err
}
expectedConfig := &Config{}
err = toml.Unmarshal(content, expectedConfig)
if err != nil {
return err
}
cfg, err := ReadConfig(ctx)
if err != nil {
return err
}
expectedConfig, err := readTestConfig()
if err != nil {
return err
}
assert.Equal(t, expectedConfig, cfg)
return err
return nil
},
[]string{"--config-file", "assets/test_config.toml"},
)
@ -99,6 +97,9 @@ func TestValuesReadFromConfigFileShouldBeOverwrittenByArgs(t *testing.T) {
t,
func(ctx *cli.Context) error {
cfg, err := ReadConfig(ctx)
if err != nil {
return err
}
MergeConfig(ctx, cfg)
@ -115,7 +116,7 @@ func TestValuesReadFromConfigFileShouldBeOverwrittenByArgs(t *testing.T) {
assert.Equal(t, expectedConfig, cfg)
return err
return nil
},
[]string{
"--config-file", "assets/test_config.toml",

View File

@ -1,13 +1,15 @@
# specify at which log level should be logged
# Possible options: trace, debug, info, warn, error
logLevel = 'debug'
[server]
host = '127.0.0.1'
port = 443
httpPort = 80
httpServerEnabled = false
httpServerEnabled = true
mainDomain = ''
rawDomain = ''
allowedCorsDomains = ['asdf', 'jkl;']
allowedCorsDomains = []
blacklistedPaths = []
[gitea]