Pulse/internal/config/persistence_metadata_test.go
rcourtman ed78509f92 Fix flaky tests and improve coverage across alerts, api, and config packages
- Fix deadlock and race conditions in internal/alerts
- Add comprehensive error path tests for internal/config
- Fix 401 handling in internal/api
- Fix Docker Swarm task filtering test logic
2026-01-03 18:36:17 +00:00

33 lines
754 B
Go

package config_test
import (
"testing"
"github.com/rcourtman/pulse-go-rewrite/internal/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestConfigPersistence_LoadGuestMetadata(t *testing.T) {
tempDir := t.TempDir()
cp := config.NewConfigPersistence(tempDir)
store, err := cp.LoadGuestMetadata()
require.NoError(t, err)
assert.NotNil(t, store)
// Ensure we can use the store
assert.Empty(t, store.GetAll())
}
func TestConfigPersistence_LoadDockerMetadata(t *testing.T) {
tempDir := t.TempDir()
cp := config.NewConfigPersistence(tempDir)
store, err := cp.LoadDockerMetadata()
require.NoError(t, err)
assert.NotNil(t, store)
// Ensure we can use the store
assert.Empty(t, store.GetAll())
}