mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 20:55:47 +00:00
test: try to fix config file not being loaded
This commit is contained in:
+11
-9
@@ -48,21 +48,23 @@ var envVar string
|
||||
var configVar string
|
||||
|
||||
func setup() {
|
||||
// setup test data
|
||||
err := os.WriteFile("author_file_test", []byte(author_data), 0644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
os.Setenv("author_file", "author_file_test")
|
||||
envVar = os.Getenv("author_file")
|
||||
|
||||
err = os.WriteFile("test_config.toml", []byte(config_data), 0644)
|
||||
err := os.WriteFile("test_config.toml", []byte(config_data), 0644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
os.Setenv("COCOMMIT_CONFIG", "test_config.toml")
|
||||
configVar = os.Getenv("COCOMMIT_CONFIG")
|
||||
utils.Find_authorfile()
|
||||
|
||||
|
||||
// setup test data
|
||||
err = os.WriteFile("author_file_test", []byte(author_data), 0644)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
os.Setenv("author_file", "author_file_test")
|
||||
envVar = os.Getenv("author_file")
|
||||
|
||||
utils.Define_users("author_file_test")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user