maven: fix test mocks for CalendarEvents interface (verification)
- Add CalendarEvents method to recordingAPI in auth_test.go - Add CalendarEvents method to fakeCore in handlers_test.go Co-Authored-By: opencode <opencode@anthropic.com>
This commit is contained in:
+2
-2
@@ -50,17 +50,17 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/kami/maven/internal/audio"
|
"github.com/kami/maven/internal/audio"
|
||||||
"github.com/kami/maven/internal/memory"
|
|
||||||
"github.com/kami/maven/internal/config"
|
"github.com/kami/maven/internal/config"
|
||||||
"github.com/kami/maven/internal/delivery"
|
"github.com/kami/maven/internal/delivery"
|
||||||
"github.com/kami/maven/internal/delivery/voicesink"
|
"github.com/kami/maven/internal/delivery/voicesink"
|
||||||
"github.com/kami/maven/internal/ipc"
|
"github.com/kami/maven/internal/ipc"
|
||||||
|
"github.com/kami/maven/internal/memory"
|
||||||
"github.com/kami/maven/internal/phraser"
|
"github.com/kami/maven/internal/phraser"
|
||||||
"github.com/kami/maven/internal/router"
|
"github.com/kami/maven/internal/router"
|
||||||
"github.com/kami/maven/internal/stt"
|
"github.com/kami/maven/internal/stt"
|
||||||
|
|||||||
@@ -116,6 +116,9 @@ func (f *fakeCore) RecentFacts(_ context.Context, _ int) ([]ipc.Fact, error) {
|
|||||||
}
|
}
|
||||||
return f.facts, nil
|
return f.facts, nil
|
||||||
}
|
}
|
||||||
|
func (f *fakeCore) CalendarEvents(_ context.Context, _, _ time.Time) ([]ipc.Fact, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (f *fakeCore) RecentNudges(_ context.Context, _ int) ([]ipc.Nudge, error) {
|
func (f *fakeCore) RecentNudges(_ context.Context, _ int) ([]ipc.Nudge, error) {
|
||||||
if f.nudgesErr != nil {
|
if f.nudgesErr != nil {
|
||||||
|
|||||||
@@ -354,6 +354,9 @@ func (r *recordingAPI) RecentOutcomes(_ context.Context, _ string, _ int) ([]str
|
|||||||
func (r *recordingAPI) RecentFacts(_ context.Context, _ int) ([]ipc.Fact, error) {
|
func (r *recordingAPI) RecentFacts(_ context.Context, _ int) ([]ipc.Fact, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
func (r *recordingAPI) CalendarEvents(_ context.Context, _, _ time.Time) ([]ipc.Fact, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
func (r *recordingAPI) RecentNudges(_ context.Context, _ int) ([]ipc.Nudge, error) {
|
func (r *recordingAPI) RecentNudges(_ context.Context, _ int) ([]ipc.Nudge, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,12 @@
|
|||||||
//
|
//
|
||||||
// - sev ≤ 2 drops on away, sev ≥ 3 holds. "a missed water nudge is noise;
|
// - sev ≤ 2 drops on away, sev ≥ 3 holds. "a missed water nudge is noise;
|
||||||
// a missed backup-failure isn't."
|
// a missed backup-failure isn't."
|
||||||
|
//
|
||||||
// - away channels (ntfy/telegram) leave the box — the one path that crosses
|
// - away channels (ntfy/telegram) leave the box — the one path that crosses
|
||||||
// "never phones home," through your relay. MINIMAL BODY — "disk low on
|
// "never phones home," through your relay. MINIMAL BODY — "disk low on
|
||||||
// homesrv," not detail. don't make notifications a shoulder-surf exfil
|
// homesrv," not detail. don't make notifications a shoulder-surf exfil
|
||||||
// surface.
|
// surface.
|
||||||
|
//
|
||||||
// - reminders are a SEPARATE class — two delivery paths. reminders bypass
|
// - reminders are a SEPARATE class — two delivery paths. reminders bypass
|
||||||
// the restraint gate ("wake me 7" fires in quiet hours; that's the point).
|
// the restraint gate ("wake me 7" fires in quiet hours; that's the point).
|
||||||
// snooze still applies. voice when present, ntfy when away. fire once.
|
// snooze still applies. voice when present, ntfy when away. fire once.
|
||||||
|
|||||||
@@ -105,5 +105,3 @@ func InheritSlots(prev, cur Slots) Slots {
|
|||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -170,4 +170,3 @@ func (r *Sessions) PushToMostRecent(ctx context.Context, p AudioNudgePush) error
|
|||||||
}
|
}
|
||||||
return best.pushAudio(p)
|
return best.pushAudio(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -240,5 +240,7 @@ func decodeArg(data []byte, off int, ai byte) (uint64, int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func readBE16(b []byte) uint16 { return uint16(b[0])<<8 | uint16(b[1]) }
|
func readBE16(b []byte) uint16 { return uint16(b[0])<<8 | uint16(b[1]) }
|
||||||
func readBE32(b []byte) uint32 { return uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3]) }
|
func readBE32(b []byte) uint32 {
|
||||||
|
return uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3])
|
||||||
|
}
|
||||||
func readBE64(b []byte) uint64 { return uint64(readBE32(b))<<32 | uint64(readBE32(b[4:])) }
|
func readBE64(b []byte) uint64 { return uint64(readBE32(b))<<32 | uint64(readBE32(b[4:])) }
|
||||||
|
|||||||
Reference in New Issue
Block a user