1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-11-03 04:17:21 -05:00
toot/tests/utils.py

22 lines
420 B
Python
Raw Normal View History

2018-06-07 04:00:50 -04:00
"""
Helpers for testing.
"""
2017-04-15 08:46:22 -04:00
class MockResponse:
def __init__(self, response_data={}, ok=True, is_redirect=False):
2017-04-15 08:46:22 -04:00
self.response_data = response_data
self.content = response_data
self.ok = ok
self.is_redirect = is_redirect
2017-04-15 08:46:22 -04:00
def raise_for_status(self):
pass
def json(self):
return self.response_data
def retval(val):
return lambda *args, **kwargs: val