aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/tests/requests/test_core.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2012-02-11 19:29:25 +0100
committerDavid Medina <davidmedina9@gmail.com>2012-02-11 21:44:10 +0100
commit7ac46101c007190294156e66a795b6e3a5cd898f (patch)
tree696166f8e10387c29d7e4971832e3b11c440f928 /pygithub3/tests/requests/test_core.py
parentEmail pattern to requests.emails (diff)
downloadpython-github3-7ac46101c007190294156e66a795b6e3a5cd898f.tar.xz
python-github3-7ac46101c007190294156e66a795b6e3a5cd898f.zip
Services.users tests completed
services.users.user services.users.emails services.users.keys services.users.followers
Diffstat (limited to 'pygithub3/tests/requests/test_core.py')
-rw-r--r--pygithub3/tests/requests/test_core.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/pygithub3/tests/requests/test_core.py b/pygithub3/tests/requests/test_core.py
index a46c1d9..68663c0 100644
--- a/pygithub3/tests/requests/test_core.py
+++ b/pygithub3/tests/requests/test_core.py
@@ -70,12 +70,17 @@ class TestRequest(TestCase):
self.assertIsNone(request.get_body())
-class TestRequestBody(TestCase):
+class TestRequestBodyWithSchema(TestCase):
def setUp(self):
valid_body = dict(schema=('arg1', 'arg2'), required=('arg1', ))
self.b = Body({}, **valid_body)
+ def test_with_body_empty_and_schema_permissive(self):
+ self.b.schema = ('arg1', 'arg2', '...')
+ self.b.required = ()
+ self.assertEqual(self.b.dumps(), {})
+
def test_with_required(self):
self.b.content = dict(arg1='arg1')
self.assertEqual(self.b.dumps(), dict(arg1='arg1'))
@@ -88,9 +93,9 @@ class TestRequestBody(TestCase):
self.b.content = 'invalid'
self.assertRaises(ValidationError, self.b.dumps)
- def test_without_body(self):
+ def test_with_body_as_None(self):
self.b.content = None
- self.assertIsNone(self.b.dumps())
+ self.assertRaises(ValidationError, self.b.dumps)
def test_only_valid_keys(self):
self.b.content = dict(arg1='arg1', arg2='arg2', fake='test')