warehouse/config/toml_test.go

23 lines
437 B
Go
Raw Permalink Normal View History

2024-11-13 21:16:22 +01:00
package config
import (
"testing"
)
func TestReadFile(t *testing.T) {
c := Default()
err := c.ReadFile("../config.example.toml")
if err != nil {
t.Fatalf("failed to read config file: %v", err)
}
// Validate the values are correctly set based on the TOML file
expectedBaseURL := "http://localhost:8080"
if c.BaseUrl != expectedBaseURL {
t.Errorf("expected BaseUrl to be '%v', got '%v'", expectedBaseURL, c.BaseUrl)
}
}