MCPcopy Create free account
hub / github.com/GetStream/stream-cli / TestTranslateMessage

Function TestTranslateMessage

pkg/cmd/chat/message/message_test.go:140–155  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

138}
139
140func TestTranslateMessage(t *testing.T) {
141 cmd := test.GetRootCmdWithSubCommands(NewCmds()...)
142 ch := test.InitChannel(t)
143 u := test.CreateUser()
144 m := test.CreateMessageWithText(ch, u, "hi")
145 t.Cleanup(func() {
146 test.DeleteMessage(m)
147 test.DeleteUser(u)
148 test.DeleteChannel(ch)
149 })
150
151 cmd.SetArgs([]string{"translate-message", "-m", m, "-l", "hu"})
152 _, err := cmd.ExecuteC()
153 require.NoError(t, err)
154 require.Contains(t, cmd.OutOrStdout().(*bytes.Buffer).String(), "szia")
155}

Callers

nothing calls this directly

Calls 9

InitChannelFunction · 0.92
CreateUserFunction · 0.92
CreateMessageWithTextFunction · 0.92
DeleteMessageFunction · 0.92
DeleteUserFunction · 0.92
DeleteChannelFunction · 0.92
StringMethod · 0.80
NewCmdsFunction · 0.70

Tested by

no test coverage detected