summaryrefslogtreecommitdiff
path: root/internal/ap/normalize_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-06-27 11:37:42 +0200
committerLibravatar GitHub <noreply@github.com>2023-06-27 11:37:42 +0200
commitd98b6318ace5f8a00a6d1776be2e78782f7eb429 (patch)
treed10ce092258e0db0c57b063483fe4ca7e307ce46 /internal/ap/normalize_test.go
parent[chore]: Bump github.com/minio/minio-go/v7 from 7.0.56 to 7.0.58 (#1928) (diff)
downloadgotosocial-d98b6318ace5f8a00a6d1776be2e78782f7eb429.tar.xz
[bugfix] Use gtserror package for WrongType errs (#1930)
* [bugfix] Use gtserror package for WrongType errs * test
Diffstat (limited to 'internal/ap/normalize_test.go')
-rw-r--r--internal/ap/normalize_test.go34
1 files changed, 1 insertions, 33 deletions
diff --git a/internal/ap/normalize_test.go b/internal/ap/normalize_test.go
index 2c9a1907a..cde807f21 100644
--- a/internal/ap/normalize_test.go
+++ b/internal/ap/normalize_test.go
@@ -18,48 +18,16 @@
package ap_test
import (
- "context"
- "encoding/json"
"testing"
"github.com/stretchr/testify/suite"
- "github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/activity/streams/vocab"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/testrig"
)
type NormalizeTestSuite struct {
- suite.Suite
-}
-
-func (suite *NormalizeTestSuite) jsonToType(rawJson string) (vocab.Type, map[string]interface{}) {
- var raw map[string]interface{}
- err := json.Unmarshal([]byte(rawJson), &raw)
- if err != nil {
- panic(err)
- }
-
- t, err := streams.ToType(context.Background(), raw)
- if err != nil {
- panic(err)
- }
-
- return t, raw
-}
-
-func (suite *NormalizeTestSuite) typeToJson(t vocab.Type) string {
- m, err := ap.Serialize(t)
- if err != nil {
- suite.FailNow(err.Error())
- }
-
- b, err := json.MarshalIndent(m, "", " ")
- if err != nil {
- suite.FailNow(err.Error())
- }
-
- return string(b)
+ APTestSuite
}
func (suite *NormalizeTestSuite) getStatusable() (vocab.ActivityStreamsNote, map[string]interface{}) {