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:
rcourtman 2025-12-02 00:29:12 +00:00
parent b864a00947
commit 890a2f792d

View file

@ -104,6 +104,17 @@ func TestNormalizeAppriseConfig(t *testing.T) {
if disabledHTTP.Enabled {
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) {