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
20 lines
423 B
Go
20 lines
423 B
Go
package config
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestLoadAlertConfig_ReadFileError(t *testing.T) {
|
|
tempDir := t.TempDir()
|
|
cp := NewConfigPersistence(tempDir)
|
|
|
|
mfs := &mockFSError{FileSystem: defaultFileSystem{}, readError: errors.New("read error")}
|
|
cp.SetFileSystem(mfs)
|
|
|
|
_, err := cp.LoadAlertConfig()
|
|
assert.Error(t, err)
|
|
assert.Contains(t, err.Error(), "read error")
|
|
}
|