MCPcopy Create free account
hub / github.com/chanify/chanify / TestActionContent

Function TestActionContent

model/message_test.go:44–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestActionContent(t *testing.T) {
45 tk, _ := ParseToken("EiJBQk9PNlRTSVhLU0VWSUpLWExEUVNVWFFSWFVBT1hHR1lZIgRjaGFuKgVNRlJHRzIUx5tXg-Vym58og7aZw05IkoDvse8..c2lnbg")
46 m := NewMessage(tk)
47 m.ActionContent("123", "abc", []string{"1|http://127.0.0.1", "2|http://127.0.0.1", "3|http://127.0.0.1", "4|http://127.0.0.1", "5|http://127.0.0.1"})
48 var ctx pb.MsgContent
49 if err := proto.Unmarshal(m.Content, &ctx); err != nil {
50 t.Fatal("Unmarshal image content failed")
51 }
52 if ctx.Actions == nil {
53 t.Fatal("Unmarshal actions failed")
54 }
55 if len(ctx.Actions) != 4 {
56 t.Fatal("Check actions failed")
57 }
58}
59
60func TestTimeContent(t *testing.T) {
61 tk, _ := ParseToken("EiJBQk9PNlRTSVhLU0VWSUpLWExEUVNVWFFSWFVBT1hHR1lZIgRjaGFuKgVNRlJHRzIUx5tXg-Vym58og7aZw05IkoDvse8..c2lnbg")

Callers

nothing calls this directly

Calls 3

ActionContentMethod · 0.95
ParseTokenFunction · 0.85
NewMessageFunction · 0.85

Tested by

no test coverage detected