diff options
author | 2012-02-09 23:01:12 +0100 | |
---|---|---|
committer | 2012-02-09 23:01:12 +0100 | |
commit | 18a8ed35b0ff6eae1bacbe0220f38a102fe4e321 (patch) | |
tree | a6c51bc90d2494947ef53a66154a074c31992b85 /pygithub3/tests/utils/requests.py | |
parent | Core tests (diff) | |
download | python-github3-18a8ed35b0ff6eae1bacbe0220f38a102fe4e321.tar.xz python-github3-18a8ed35b0ff6eae1bacbe0220f38a102fe4e321.zip |
Utils to tests
Diffstat (limited to '')
-rw-r--r-- | pygithub3/tests/utils/requests.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/pygithub3/tests/utils/requests.py b/pygithub3/tests/utils/requests.py new file mode 100644 index 0000000..4d170c1 --- /dev/null +++ b/pygithub3/tests/utils/requests.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- + +from .base import Request, DummyResource, DummyRequest +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') + +def mock_json_dumps(content): + return content |