mirror of
https://github.com/photoprism/photoprism.git
synced 2025-09-26 21:01:58 +08:00
Commands: Refactor "show config-options" and "show config-yaml" tests
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -20,8 +20,8 @@ func TestMain(m *testing.M) {
|
||||
|
||||
c := config.NewTestConfig("commands")
|
||||
get.SetConfig(c)
|
||||
defer c.CloseDb()
|
||||
|
||||
// Init config and connect to database.
|
||||
InitConfig = func(ctx *cli.Context) (*config.Config, error) {
|
||||
return c, c.Init()
|
||||
}
|
||||
@@ -29,6 +29,9 @@ func TestMain(m *testing.M) {
|
||||
// Run unit tests.
|
||||
code := m.Run()
|
||||
|
||||
// Close database connection.
|
||||
c.CloseDb()
|
||||
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user