[go: up one dir, main page]

File: utils.py

package info (click to toggle)
toot 0.34.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 868 kB
  • sloc: python: 4,858; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 420 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""
Helpers for testing.
"""


class MockResponse:
    def __init__(self, response_data={}, ok=True, is_redirect=False):
        self.response_data = response_data
        self.content = response_data
        self.ok = ok
        self.is_redirect = is_redirect

    def raise_for_status(self):
        pass

    def json(self):
        return self.response_data


def retval(val):
    return lambda *args, **kwargs: val