restructuring + tidying
This commit is contained in:
@ -53,7 +53,7 @@ var Run action.GTSAction = func(ctx context.Context, _ *config.Config, log *logr
|
||||
if err := distributor.Start(); err != nil {
|
||||
return fmt.Errorf("error starting distributor: %s", err)
|
||||
}
|
||||
mastoConverter := NewTestMastoConverter(dbService)
|
||||
mastoConverter := NewTestTypeConverter(dbService)
|
||||
|
||||
c := NewTestConfig()
|
||||
|
||||
|
||||
76
testrig/samplenote.json
Normal file
76
testrig/samplenote.json
Normal file
@ -0,0 +1,76 @@
|
||||
{
|
||||
"@context": [
|
||||
"https://www.w3.org/ns/activitystreams",
|
||||
{
|
||||
"ostatus": "http://ostatus.org#",
|
||||
"atomUri": "ostatus:atomUri",
|
||||
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
|
||||
"conversation": "ostatus:conversation",
|
||||
"sensitive": "as:sensitive",
|
||||
"toot": "http://joinmastodon.org/ns#",
|
||||
"votersCount": "toot:votersCount",
|
||||
"blurhash": "toot:blurhash",
|
||||
"focalPoint": {
|
||||
"@container": "@list",
|
||||
"@id": "toot:focalPoint"
|
||||
}
|
||||
}
|
||||
],
|
||||
"id": "https://ondergrond.org/users/dumpsterqueer/statuses/106124968746291389/activity",
|
||||
"type": "Create",
|
||||
"actor": "https://ondergrond.org/users/dumpsterqueer",
|
||||
"published": "2021-04-25T08:15:12Z",
|
||||
"to": [
|
||||
"https://ondergrond.org/users/dumpsterqueer/followers"
|
||||
],
|
||||
"cc": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"object": {
|
||||
"id": "https://ondergrond.org/users/dumpsterqueer/statuses/106124968746291389",
|
||||
"type": "Note",
|
||||
"summary": "selfie",
|
||||
"inReplyTo": null,
|
||||
"published": "2021-04-25T08:15:12Z",
|
||||
"url": "https://ondergrond.org/@dumpsterqueer/106124968746291389",
|
||||
"attributedTo": "https://ondergrond.org/users/dumpsterqueer",
|
||||
"to": [
|
||||
"https://ondergrond.org/users/dumpsterqueer/followers"
|
||||
],
|
||||
"cc": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"sensitive": true,
|
||||
"atomUri": "https://ondergrond.org/users/dumpsterqueer/statuses/106124968746291389",
|
||||
"inReplyToAtomUri": null,
|
||||
"conversation": "tag:ondergrond.org,2021-04-25:objectId=1058287:objectType=Conversation",
|
||||
"content": "\u003cp\u003egood morning i\u0026apos;m up and at \u0026apos;em\u003c/p\u003e",
|
||||
"contentMap": {
|
||||
"en": "\u003cp\u003egood morning i\u0026apos;m up and at \u0026apos;em\u003c/p\u003e"
|
||||
},
|
||||
"attachment": [
|
||||
{
|
||||
"type": "Document",
|
||||
"mediaType": "image/jpeg",
|
||||
"url": "https://ondergrond.org/system/media_attachments/files/106/124/965/963/257/833/original/84bade009d44f0e7.jpg",
|
||||
"name": "me sitting in front of my computer, looking a bit tired but overall rather cute. I've got a green and grey plaid shirt on which is very wrinked.",
|
||||
"blurhash": "UXF6Ur_N-=t7~p-pt7RjayayRkRkRjWVafof",
|
||||
"focalPoint": [
|
||||
0.0,
|
||||
0.52
|
||||
]
|
||||
}
|
||||
],
|
||||
"tag": [],
|
||||
"replies": {
|
||||
"id": "https://ondergrond.org/users/dumpsterqueer/statuses/106124968746291389/replies",
|
||||
"type": "Collection",
|
||||
"first": {
|
||||
"type": "CollectionPage",
|
||||
"next": "https://ondergrond.org/users/dumpsterqueer/statuses/106124968746291389/replies?only_other_accounts=true\u0026page=true",
|
||||
"partOf": "https://ondergrond.org/users/dumpsterqueer/statuses/106124968746291389/replies",
|
||||
"items": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -20,10 +20,10 @@ package testrig
|
||||
|
||||
import (
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/mastotypes"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
|
||||
)
|
||||
|
||||
// NewTestMastoConverter returned a mastotypes converter with the given db and the default test config
|
||||
func NewTestMastoConverter(db db.DB) mastotypes.Converter {
|
||||
return mastotypes.New(NewTestConfig(), db)
|
||||
// NewTestTypeConverter returned a type converter with the given db and the default test config
|
||||
func NewTestTypeConverter(db db.DB) typeutils.TypeConverter {
|
||||
return typeutils.NewConverter(NewTestConfig(), db)
|
||||
}
|
||||
Reference in New Issue
Block a user