funfedi_parsing_test_cases.cases ¶
ActivityTestCase
dataclass
¶
ActivityTestCaseMaker
dataclass
¶
Creates an Activity test case
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
object_maker
|
Callable[list, dict]
|
|
<function default_object_maker at 0x7f199b829170>
|
activity_maker
|
Callable[list, dict]
|
|
<function default_activity_maker at 0x7f199b829590>
|
Source code in funfedi_parsing_test_cases/cases/activity.py
default_activity_maker ¶
default_activity_maker(
environment: Environment, obj: dict
) -> dict
>>> from funfedi_parsing_test_cases.testing import default_env
>>> obj = default_object_maker(default_env)
>>> default_activity_maker(default_env, obj)
{'@context': ['https://www.w3.org/ns/activitystreams'],
'actor': 'http://host.test/some/actor',
'id': '...
'object': ...
'published': '...
'to': ['https://www.w3.org/ns/activitystreams#Public', 'http://other.test/some/actor'],
'cc': [],
'type': 'Create'}
Source code in funfedi_parsing_test_cases/cases/defaults.py
default_event_maker ¶
default_event_maker(environment: Environment) -> dict
>>> from funfedi_parsing_test_cases.testing import default_env
>>> default_event_maker(default_env)
{'@context': ['https://www.w3.org/ns/activitystreams'],
'id': '...
'type': 'Event',
'attributedTo': 'http://host.test/some/actor',
'to': ['https://www.w3.org/ns/activitystreams#Public', 'http://other.test/some/actor'],
'cc': [],
'published': '...
'content': 'event content',
'name': 'my event',
'startTime': '...
'endTime': '...
'location': {'type': 'VirtualLocation', 'url': 'http://localhost'}}
Source code in funfedi_parsing_test_cases/cases/defaults.py
default_object_maker ¶
default_object_maker(environment: Environment) -> dict
>>> from funfedi_parsing_test_cases.testing import default_env
>>> default_object_maker(default_env)
{'@context': ['https://www.w3.org/ns/activitystreams'],
'id': '...
'type': 'Note',
'attributedTo': 'http://host.test/some/actor',
'to': ['https://www.w3.org/ns/activitystreams#Public', 'http://other.test/some/actor'],
'cc': [],
'published': '...
'content': 'text',
'tag': [{'type': 'Mention', 'href': 'http://other.test/some/actor'}]}
Source code in funfedi_parsing_test_cases/cases/defaults.py
default_poll_maker ¶
default_poll_maker(environment: Environment) -> dict
>>> from funfedi_parsing_test_cases.testing import default_env
>>> default_poll_maker(default_env)
{'@context': ['https://www.w3.org/ns/activitystreams'],
'id': '...
'type': 'Question',
'attributedTo': 'http://host.test/some/actor',
'to': ['https://www.w3.org/ns/activitystreams#Public', 'http://other.test/some/actor'],
'cc': [],
'published': '...
'content': '<p>Question</p>',
'endTime': '...
'updated': '...
'oneOf': [{'type': 'Note', 'name': 'Answer 1', 'replies': {'type': 'Collection', 'totalItems': 0}},
{'type': 'Note', 'name': 'Answer 2', 'replies': {'type': 'Collection', 'totalItems': 0}}]}