INNER CODE UNIT · Go

TestSetupConfig

welovemedia/ffmate · cmd/server_test.go:13

func TestSetupConfig(t *testing.T) {
	viper.Set("database", "postgresql://localhost:5432/testdb")
	viper.Set("ffmpeg", "/usr/bin/ffmpeg")
	viper.Set("debug", "info:*")
	viper.Set("maxConcurrentTasks", 5)
	viper.Set("tray", true)
	viper.Set("noUI", false)
	viper.Set("identifier", "")
	viper.Set("sendTelemetry", true)

	// Remove /.dockerenv to simulate non-Docker environment
	_ = os.Remove("/.dockerenv")

	setupConfig()

	assert.Equal(t, "/usr/bin/ffmpeg", cfg.GetString("ffmate.ffmpeg"))
	assert.Equal(t, "info:*", cfg.GetString("ffmate.debug"))
	assert.Equal(t, 5, cfg.GetInt("ffmate.maxConcurrentTasks"))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…