aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/tests/utils/requests.py
blob: ead94a62e42d8a36428c8af6c22f744c13de2eab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
# -*- encoding: utf-8 -*-

from .base import Request, DummyResource, DummyRequest, mock_json
from pygithub3.exceptions import ValidationError


class RequestWithArgs(Request):

    uri = 'URI/{arg1}/{arg2}'


class RequestCleanedUri(Request):

    uri = 'URI/{arg1}/{arg2}'

    def clean_uri(self):
        if not self.arg1:
            return 'URI'


class RequestBodyWithSchema(Request):
    uri = 'URI'
    body_schema = ('arg1', 'arg2')


class RequestCleanedBody(Request):

    uri = 'URI'

    def clean_body(self):
        raise ValidationError('test')