test: Add edge case for NormalizeAppriseConfig low timeout
Test TimeoutSeconds value between 1-4 clamps to minimum of 5. Coverage: 97.4% → 100%
This commit is contained in:
parent
b864a00947
commit
890a2f792d
1 changed files with 11 additions and 0 deletions
|
|
@ -104,6 +104,17 @@ func TestNormalizeAppriseConfig(t *testing.T) {
|
||||||
if disabledHTTP.Enabled {
|
if disabledHTTP.Enabled {
|
||||||
t.Fatalf("expected HTTP config without server URL to disable notifications")
|
t.Fatalf("expected HTTP config without server URL to disable notifications")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test timeout below minimum (1-4 seconds should clamp to 5)
|
||||||
|
lowTimeout := NormalizeAppriseConfig(AppriseConfig{
|
||||||
|
Enabled: true,
|
||||||
|
Mode: AppriseModeHTTP,
|
||||||
|
ServerURL: "https://apprise.example.com",
|
||||||
|
TimeoutSeconds: 3,
|
||||||
|
})
|
||||||
|
if lowTimeout.TimeoutSeconds != 5 {
|
||||||
|
t.Fatalf("expected timeout to clamp to 5 for values 1-4, got %d", lowTimeout.TimeoutSeconds)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSetCooldownClampsNegativeValues(t *testing.T) {
|
func TestSetCooldownClampsNegativeValues(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue