]> git.giacomolli.uk - onechat/blob - subagent_helper_test.go
Accept owner photos and image files in Telegram
[onechat] / subagent_helper_test.go
1 package main
2
3 import (
4         "path/filepath"
5         "testing"
6
7         "github.com/stretchr/testify/require"
8 )
9
10 // newTestSubagents returns the subagents of a new agent directory, with random
11 // names, and closes them at the end of the test.
12 func newTestSubagents(t *testing.T) *Subagents {
13         t.Helper()
14
15         subagents := newSubagents(filepath.Join(t.TempDir(), subagentDirName), newTestClock().Now, subagentNameRandom)
16         t.Cleanup(func() {
17                 require.NoError(t, subagents.Close())
18         })
19
20         return subagents
21 }