mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-19 12:54:24 +02:00
fix tests
This commit is contained in:
parent
5ed4ca2500
commit
7b3a09d8ac
2 changed files with 18 additions and 15 deletions
|
@ -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",
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue