test: fix unused variables in notification tests

Fix compilation errors from unused variables in manager_test.go and
pushover_test.go. The batching logic tests were already in place and
passing:

- TestBatchingThreeLowEvents: 3 LOW events in 10s -> 1 notification
- TestBatchingUrgentBypassesBatch: 1 URGENT -> immediate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-04-11 04:26:49 -04:00
parent 3d76c1534c
commit 4d6a532b2c
2 changed files with 8 additions and 7 deletions

View file

@ -1,6 +1,7 @@
package notifications
import (
"fmt"
"testing"
"time"
)
@ -280,7 +281,6 @@ func TestQuietHoursQueueing(t *testing.T) {
defer m.Close()
// Set quiet hours to cover current time
now := time.Now().In(loc)
cfg := NotificationConfig{
Channel: "default",
QuietFrom: "00:00",
@ -492,7 +492,7 @@ func TestQuietDaysBitmask(t *testing.T) {
}
// Should be queued (current day is in quiet hours)
low, medium, digest := m.GetPendingCount()
_, _, digest := m.GetPendingCount()
if digest != 1 {
t.Errorf("queuedForDigest = %d, want 1 (current day should be in quiet hours)", digest)
}
@ -528,7 +528,7 @@ func TestMediumPriorityBatching(t *testing.T) {
}
// Events should be queued
low, medium, _ := m.GetPendingCount()
_, medium, _ := m.GetPendingCount()
if medium != 2 {
t.Errorf("pendingMedium = %d, want 2", medium)
}
@ -537,7 +537,7 @@ func TestMediumPriorityBatching(t *testing.T) {
time.Sleep(1500 * time.Millisecond)
// Should be flushed now
low, medium, _ = m.GetPendingCount()
_, medium, _ = m.GetPendingCount()
if medium != 0 {
t.Errorf("pendingMedium = %d, want 0 after flush", medium)
}
@ -1370,7 +1370,7 @@ func TestHighPriorityDuringQuietHours(t *testing.T) {
defer m.Close()
// Set quiet hours
now := time.Now().In(loc)
_ = time.Now().In(loc)
cfg := NotificationConfig{
Channel: "default",
QuietFrom: "00:00",

View file

@ -2,7 +2,9 @@ package notifications
import (
"bytes"
"encoding/base64"
"io"
"mime/multipart"
"net/http"
"net/http/httptest"
"strings"
@ -151,9 +153,8 @@ func TestPushoverSendWithPriority(t *testing.T) {
// TestPushoverSendWithPNGAttachment tests sending with PNG attachment.
func TestPushoverSendWithPNGAttachment(t *testing.T) {
var receivedBody []byte
var contentType string
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
contentType = r.Header.Get("Content-Type")
_ = r.Header.Get("Content-Type")
receivedBody, _ = io.ReadAll(r.Body)
w.WriteHeader(http.StatusOK)
}))