diff options
| author | 2012-02-10 21:54:38 +0100 | |
|---|---|---|
| committer | 2012-02-11 21:44:09 +0100 | |
| commit | 67ebcdbf46927b22fd75ae87ecb08567e14e4a21 (patch) | |
| tree | 40b86b5ffb5f30584aee03a9d12236a8164b686b /pygithub3/tests/requests/test_core.py | |
| parent | Fix asserts bugs in client. (diff) | |
| download | python-github3-67ebcdbf46927b22fd75ae87ecb08567e14e4a21.tar.xz python-github3-67ebcdbf46927b22fd75ae87ecb08567e14e4a21.zip | |
Wip on services.users
Diffstat (limited to 'pygithub3/tests/requests/test_core.py')
| -rw-r--r-- | pygithub3/tests/requests/test_core.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pygithub3/tests/requests/test_core.py b/pygithub3/tests/requests/test_core.py index f29ab1d..98c5f3f 100644 --- a/pygithub3/tests/requests/test_core.py +++ b/pygithub3/tests/requests/test_core.py @@ -34,6 +34,7 @@ class TestFactory(TestCase): request = self.f('users.get') self.assertIsInstance(request, Request) + class TestRequestUri(TestCase): def test_SIMPLE_with_correct_args(self): @@ -80,12 +81,17 @@ class TestRequestBody(TestCase): class TestBodyParsers(TestCase): - def setUp(self): - self.b = Body( + def test_only_valid_keys(self): + body = Body( dict(arg1='arg1', arg2='arg2', arg3='arg3', arg4='arg4'), ('arg1', 'arg3', 'arg4')) - - def test_RETURN_only_valid_keys(self): - get_body_returns = self.b.parse() - self.assertEqual(get_body_returns, dict(arg1='arg1', arg3='arg3', + self.assertEqual(body.parse(), dict(arg1='arg1', arg3='arg3', arg4='arg4')) + + def test_none(self): + body = Body({}, ('arg1', 'arg2')) + self.assertEqual(body.parse(), {}) + + def test_invalid_content(self): + body = Body('invalid', ('arg1',)) + self.assertRaises(ValidationError, body.parse) |
