test: updated test cases

This commit is contained in:
Marvin Zhang
2024-10-20 17:55:57 +08:00
parent b5e888f3e1
commit cecf4dfd1d
20 changed files with 79 additions and 321 deletions

View File

@@ -60,6 +60,9 @@ server:
err = os.WriteFile(configPath, configContent, 0644)
require.NoError(t, err, "Failed to write config file")
// Remove the environment variable before testing with config file
os.Unsetenv("CRAWLAB_MONGO_HOST")
// Create a new Config instance with the config file
cWithFile := Config{Name: configPath}
err = cWithFile.Init()