Page MenuHomeMusing Studio

activitypub_test.go
No OneTemporary

activitypub_test.go

package writefreely
import (
"testing"
"github.com/writeas/web-core/activitystreams"
)
var actorTestTable = []struct {
Name string
Resp []byte
}{
{
"Context as a string",
[]byte(`{"@context":"https://www.w3.org/ns/activitystreams"}`),
},
{
"Context as a list",
[]byte(`{"@context":["one string", "two strings"]}`),
},
}
func TestUnmarshalActor(t *testing.T) {
for _, tc := range actorTestTable {
actor := activitystreams.Person{}
err := unmarshalActor(tc.Resp, &actor)
if err != nil {
t.Errorf("%s failed with error %s", tc.Name, err)
}
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Jun 7, 12:29 AM (12 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3256311

Event Timeline