mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 11:30:15 +00:00
- 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
33 lines
754 B
Go
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())
|
|
}
|