X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/153f3f9b4b09d521412eacca30eddeed395c3f41..b94f6248bfaa989d4da6b0980648be20bf5a07d2:/telegram_test.go?ds=sidebyside diff --git a/telegram_test.go b/telegram_test.go index a1a1ed2..44c9c8f 100644 --- a/telegram_test.go +++ b/telegram_test.go @@ -21,7 +21,7 @@ func TestOwnerTalksToTheAgentThroughTelegram(t *testing.T) { telegram := newTelegramFake(t) bot, _ := telegramStartTestBot(t, telegram) - socket := startTestDaemonWithBot(t, server, bot) + socket := daemonStartTestWithBot(t, server, bot) terminal := terminalStartTestClient(t, socket) terminal.WaitFor(t, "[connected to OneChat]") @@ -43,7 +43,7 @@ func TestOwnerTalksToTheAgentThroughTelegram(t *testing.T) { func TestBotIgnoresEveryoneButTheOwner(t *testing.T) { telegram := newTelegramFake(t) bot, logs := telegramStartTestBot(t, telegram) - socket := startTestDaemonWithBot(t, newModelFake(t), bot) + socket := daemonStartTestWithBot(t, newModelFake(t), bot) terminal := terminalStartTestClient(t, socket) terminal.WaitFor(t, "[connected to OneChat]") @@ -81,7 +81,7 @@ func TestBotIgnoresEveryoneButTheOwner(t *testing.T) { func TestBotAnswersThatOnlyTextIsSupported(t *testing.T) { telegram := newTelegramFake(t) bot, _ := telegramStartTestBot(t, telegram) - startTestDaemonWithBot(t, newModelFake(t), bot) + daemonStartTestWithBot(t, newModelFake(t), bot) telegram.Add(TelegramUpdate{ UpdateID: 1, @@ -106,7 +106,7 @@ func TestStopFromTelegramInterruptsTheTurn(t *testing.T) { telegram := newTelegramFake(t) bot, _ := telegramStartTestBot(t, telegram) - startTestDaemonWithBot(t, server, bot) + daemonStartTestWithBot(t, server, bot) telegram.Add(TelegramUpdate{ UpdateID: 1, @@ -149,7 +149,7 @@ func TestBotStartsAtTheStoredOffset(t *testing.T) { Message: telegramOwnerMessage("new after the restart"), }) - socket := startTestDaemonWithBot(t, server, bot) + socket := daemonStartTestWithBot(t, server, bot) terminal := terminalStartTestClient(t, socket) terminal.WaitFor(t, "[connected to OneChat]") telegramWaitForSent(t, telegram, "ok") @@ -189,7 +189,7 @@ func TestBotTriesAgainAfterFailures(t *testing.T) { } bot, logs := telegramStartTestBot(t, telegram) - startTestDaemonWithBot(t, server, bot) + daemonStartTestWithBot(t, server, bot) telegram.Add(TelegramUpdate{ UpdateID: 1, @@ -236,7 +236,7 @@ func TestRepliesGoAsRichMessages(t *testing.T) { telegram := newTelegramFake(t) bot, _ := telegramStartTestBot(t, telegram) - socket := startTestDaemonWithBot(t, server, bot) + socket := daemonStartTestWithBot(t, server, bot) terminal := terminalStartTestClient(t, socket) terminal.WaitFor(t, "[connected to OneChat]") @@ -423,7 +423,7 @@ func TestBotLogsNoTokenWhenTheNetworkFails(t *testing.T) { telegram.Close() bot, logs := telegramStartTestBot(t, telegram) - startTestDaemonWithBot(t, newModelFake(t), bot) + daemonStartTestWithBot(t, newModelFake(t), bot) require.Eventually(t, func() bool { return strings.Count(logs.String(), "no valid answer") >= 2