Embellish framework: first stubs

2019-08-17
Marnanel Thurman 2019-04-25 01:12:05 +01:00
rodzic 696192daaa
commit 488770e5ba
2 zmienionych plików z 38 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,2 @@
def embellish(thing):
return thing

Wyświetl plik

@ -0,0 +1,36 @@
from django.test import TestCase
from django_kepi.embellish import embellish
class TestEmbellish(TestCase):
def test_embellish(self):
SOURCE = {
'id': 'https://example.com/users/fred/status/1234',
'type': 'Note',
'content': 'Hello world',
}
EXPECTING = {
'id': 'https://example.com/users/fred/status/1234',
'url': 'https://example.com/users/fred/status/1234',
'atomUri': 'https://example.com/users/fred/status/1234',
'type': 'Note',
'content': 'Hello world',
'summary': None,
"attributedTo": "https://example.com/users/fred",
"to":["https://www.w3.org/ns/activitystreams#Public"],
"cc":["https://example.com/users/fred/followers"],
"sensitive": False,
"inReplyTo": None,
"inReplyToAtomUri": None,
"contentMap":{"en": 'Hello world',},
"attachment":[],
"tag":[],
}
# (plus "published")
# (plus "conversation", wtf?)
self.assertEqual(
embellish(SOURCE),
EXPECTING)