aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/tests/utils/requests.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygithub3/tests/utils/requests.py')
-rw-r--r--pygithub3/tests/utils/requests.py35
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