Add clean command
This commit is contained in:
@@ -115,6 +115,15 @@ func TestSessionSpoolAudioDir(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSessionSpoolDir(t *testing.T) {
|
||||
root := "/var/spool/narratio"
|
||||
got := SessionSpoolDir(root, "forsaken", "2026-04-19")
|
||||
want := filepath.Join(root, "forsaken", "2026-04-19")
|
||||
if got != want {
|
||||
t.Fatalf("SessionSpoolDir() = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSessionSpoolRestoreAudioDir(t *testing.T) {
|
||||
root := "/var/spool/narratio"
|
||||
got := SessionSpoolRestoreAudioDir(root, "forsaken", "2026-04-19")
|
||||
@@ -135,6 +144,17 @@ func TestS3AudioCachePath(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestS3AudioCacheNamespaceDir(t *testing.T) {
|
||||
got, err := S3AudioCacheNamespaceDir("/var/cache/narratio", "my-dnd-archive", "dnd")
|
||||
if err != nil {
|
||||
t.Fatalf("S3AudioCacheNamespaceDir() error = %v", err)
|
||||
}
|
||||
want := filepath.Join("/var/cache/narratio", "s3", "my-dnd-archive", "dnd", "campaigns")
|
||||
if got != want {
|
||||
t.Fatalf("S3AudioCacheNamespaceDir() = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestS3AudioCachePathRejectsUnsafeInputs(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
Reference in New Issue
Block a user