Add tests for remaining ActivityVocabulary types

This commit is contained in:
Jaidyn Ann 2024-06-23 21:02:16 -05:00
parent 56d4706557
commit a2aec426ab
53 changed files with 616 additions and 1 deletions

View File

@ -44,7 +44,8 @@
We compare the original JSON to that of the parsed-then-reserialized JSON,
ensuring they are semantically equivalent. White-space and key order are ignored."
(let ((content (alexandria:read-file-into-string (relative-pathname path))))
`(define-test ,(intern (string-upcase (pathname-name path))) (:tags ,tags)
`(define-test ,(intern (format nil "EX-~A" (string-upcase (pathname-name path))))
(:tags ,tags)
(assert-equal
(hash-table-sorted-alist
(yason:parse ,content))

View File

@ -0,0 +1,17 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally accepted Joe into the club",
"type": "Accept",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Person",
"name": "Joe"
},
"target": {
"type": "Group",
"name": "The Club"
}
}

View File

@ -0,0 +1,17 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally accepted an invitation to a party",
"type": "Accept",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Invite",
"actor": "http://john.example.org",
"object": {
"type": "Event",
"name": "Going-Away Party for Jim"
}
}
}

View File

@ -0,0 +1,22 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally added a picture of her cat to her cat picture collection",
"type": "Add",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Image",
"name": "A picture of my cat",
"url": "http://example.org/img/cat.png"
},
"origin": {
"type": "Collection",
"name": "Camera Roll"
},
"target": {
"type": "Collection",
"name": "My Cat Pictures"
}
}

View File

@ -0,0 +1,10 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally added an object",
"type": "Add",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": "http://example.org/abc"
}

View File

@ -0,0 +1,18 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally announced that she had arrived at work",
"type": "Announce",
"actor": {
"type": "Person",
"id": "http://sally.example.org",
"name": "Sally"
},
"object": {
"type": "Arrive",
"actor": "http://sally.example.org",
"location": {
"type": "Place",
"name": "Work"
}
}
}

View File

@ -0,0 +1,5 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Application",
"name": "Exampletron 3000"
}

View File

@ -0,0 +1,17 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally arrived at work",
"type": "Arrive",
"actor": {
"type": "Person",
"name": "Sally"
},
"location": {
"type": "Place",
"name": "Work"
},
"origin": {
"type": "Place",
"name": "Home"
}
}

View File

@ -0,0 +1,7 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Article",
"name": "What a Crazy Day I Had",
"content": "<div>... you will never believe ...</div>",
"attributedTo": "http://sally.example.org"
}

View File

@ -0,0 +1,10 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Audio",
"name": "Interview With A Famous Technologist",
"url": {
"type": "Link",
"href": "http://example.org/podcast.mp3",
"mediaType": "audio/mp3"
}
}

View File

@ -0,0 +1,7 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally blocked Joe",
"type": "Block",
"actor": "http://sally.example.org",
"object": "http://joe.example.org"
}

View File

@ -0,0 +1,14 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally created a note",
"type": "Create",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Note",
"name": "A Simple Note",
"content": "This is a simple note"
}
}

View File

@ -0,0 +1,14 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally deleted a note",
"type": "Delete",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": "http://example.org/notes/1",
"origin": {
"type": "Collection",
"name": "Sally's Notes"
}
}

View File

@ -0,0 +1,7 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally disliked a post",
"type": "Dislike",
"actor": "http://sally.example.org",
"object": "http://example.org/posts/1"
}

View File

@ -0,0 +1,6 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Document",
"name": "4Q Sales Forecast",
"url": "http://example.org/4q-sales-forecast.pdf"
}

View File

@ -0,0 +1,7 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Event",
"name": "Going-Away Party for Jim",
"startTime": "2014-12-31T23:00:00-08:00",
"endTime": "2015-01-01T06:00:00-08:00"
}

View File

@ -0,0 +1,10 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally flagged an inappropriate note",
"type": "Flag",
"actor": "http://sally.example.org",
"object": {
"type": "Note",
"content": "An inappropriate note"
}
}

View File

@ -0,0 +1,13 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally followed John",
"type": "Follow",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Person",
"name": "John"
}
}

View File

@ -0,0 +1,5 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Group",
"name": "Big Beards of Austin"
}

View File

@ -0,0 +1,10 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally ignored a note",
"type": "Ignore",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": "http://example.org/notes/1"
}

View File

@ -0,0 +1,17 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Image",
"name": "Cat Jumping on Wagon",
"url": [
{
"type": "Link",
"href": "http://example.org/image.jpeg",
"mediaType": "image/jpeg"
},
{
"type": "Link",
"href": "http://example.org/image.png",
"mediaType": "image/png"
}
]
}

View File

@ -0,0 +1,23 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally invited John and Lisa to a party",
"type": "Invite",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Event",
"name": "A Party"
},
"target": [
{
"type": "Person",
"name": "John"
},
{
"type": "Person",
"name": "Lisa"
}
]
}

View File

@ -0,0 +1,13 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally joined a group",
"type": "Join",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Group",
"name": "A Simple Group"
}
}

View File

@ -0,0 +1,13 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally left a group",
"type": "Leave",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Group",
"name": "A Simple Group"
}
}

View File

@ -0,0 +1,13 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally left work",
"type": "Leave",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Place",
"name": "Work"
}
}

View File

@ -0,0 +1,10 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally liked a note",
"type": "Like",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": "http://example.org/notes/1"
}

View File

@ -0,0 +1,10 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally listened to a piece of music",
"type": "Listen",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": "http://example.org/music.mp3"
}

View File

@ -0,0 +1,7 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Mention of Joe by Carrie in her note",
"type": "Mention",
"href": "http://example.org/joe",
"name": "Joe"
}

View File

@ -0,0 +1,18 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally moved a post from List A to List B",
"type": "Move",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": "http://example.org/posts/1",
"target": {
"type": "Collection",
"name": "List B"
},
"origin": {
"type": "Collection",
"name": "List A"
}
}

View File

@ -0,0 +1,6 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Note",
"name": "A Word of Warning",
"content": "Looks like it is going to rain today. Bring an umbrella!"
}

View File

@ -0,0 +1,17 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally offered 50% off to Lewis",
"type": "Offer",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "http://www.types.example/ProductOffer",
"name": "50% Off!"
},
"target": {
"type": "Person",
"name": "Lewis"
}
}

View File

@ -0,0 +1,5 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Organization",
"name": "Example Co."
}

View File

@ -0,0 +1,6 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Page",
"name": "Omaha Weather Report",
"url": "http://example.org/weather-in-omaha.html"
}

View File

@ -0,0 +1,5 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Person",
"name": "Sally Smith"
}

View File

@ -0,0 +1,9 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Place",
"name": "Fresno Area",
"latitude": 36.75,
"longitude": 119.7667,
"radius": 15,
"units": "miles"
}

View File

@ -0,0 +1,5 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Place",
"name": "Work"
}

View File

@ -0,0 +1,9 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Profile",
"summary": "Sally's Profile",
"describes": {
"type": "Person",
"name": "Sally Smith"
}
}

View File

@ -0,0 +1,6 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Question",
"name": "What is the answer?",
"closed": "2016-05-10T00:00:00Z"
}

View File

@ -0,0 +1,15 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Question",
"name": "What is the answer?",
"oneOf": [
{
"type": "Note",
"name": "Option A"
},
{
"type": "Note",
"name": "Option B"
}
]
}

View File

@ -0,0 +1,10 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally read a blog post",
"type": "Read",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": "http://example.org/posts/1"
}

View File

@ -0,0 +1,17 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally rejected an invitation to a party",
"type": "Reject",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Invite",
"actor": "http://john.example.org",
"object": {
"type": "Event",
"name": "Going-Away Party for Jim"
}
}
}

View File

@ -0,0 +1,14 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally is an acquaintance of John",
"type": "Relationship",
"subject": {
"type": "Person",
"name": "Sally"
},
"relationship": "http://purl.org/vocab/relationship/acquaintanceOf",
"object": {
"type": "Person",
"name": "John"
}
}

View File

@ -0,0 +1,17 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "The moderator removed Sally from a group",
"type": "Remove",
"actor": {
"type": "http://example.org/Role",
"name": "The Moderator"
},
"object": {
"type": "Person",
"name": "Sally"
},
"origin": {
"type": "Group",
"name": "A Simple Group"
}
}

View File

@ -0,0 +1,14 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally removed a note from her notes folder",
"type": "Remove",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": "http://example.org/notes/1",
"target": {
"type": "Collection",
"name": "Notes Folder"
}
}

View File

@ -0,0 +1,5 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Service",
"name": "Acme Web Service"
}

View File

@ -0,0 +1,17 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally tentatively accepted an invitation to a party",
"type": "TentativeAccept",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Invite",
"actor": "http://john.example.org",
"object": {
"type": "Event",
"name": "Going-Away Party for Jim"
}
}
}

View File

@ -0,0 +1,17 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally tentatively rejected an invitation to a party",
"type": "TentativeReject",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Invite",
"actor": "http://john.example.org",
"object": {
"type": "Event",
"name": "Going-Away Party for Jim"
}
}
}

View File

@ -0,0 +1,21 @@
{
"type": "OrderedCollection",
"totalItems": 3,
"name": "Vacation photos 2016",
"orderedItems": [
{
"type": "Image",
"id": "http://image.example/1"
},
{
"type": "Tombstone",
"formerType": "Image",
"id": "http://image.example/2",
"deleted": "2016-03-17T00:00:00Z"
},
{
"type": "Image",
"id": "http://image.example/3"
}
]
}

View File

@ -0,0 +1,17 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally went home from work",
"type": "Travel",
"actor": {
"type": "Person",
"name": "Sally"
},
"target": {
"type": "Place",
"name": "Home"
},
"origin": {
"type": "Place",
"name": "Work"
}
}

View File

@ -0,0 +1,12 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally retracted her offer to John",
"type": "Undo",
"actor": "http://sally.example.org",
"object": {
"type": "Offer",
"actor": "http://sally.example.org",
"object": "http://example.org/posts/1",
"target": "http://john.example.org"
}
}

View File

@ -0,0 +1,10 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally updated her note",
"type": "Update",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": "http://example.org/notes/1"
}

View File

@ -0,0 +1,7 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Video",
"name": "Puppy Plays With Ball",
"url": "http://example.org/video.mkv",
"duration": "PT2H"
}

View File

@ -0,0 +1,13 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"summary": "Sally read an article",
"type": "View",
"actor": {
"type": "Person",
"name": "Sally"
},
"object": {
"type": "Article",
"name": "What You Should Know About Activity Streams"
}
}