diff options
author | 2012-02-10 08:40:40 +0100 | |
---|---|---|
committer | 2012-02-10 08:40:40 +0100 | |
commit | 4dbd53a7b438d9d7b13bc0afe903c54cd85cb176 (patch) | |
tree | a7e8bb16a9ed53371457a5c21b4ecdd2c94f4f14 /pygithub3/tests/services/test_users.py | |
parent | Services tests (diff) | |
download | python-github3-4dbd53a7b438d9d7b13bc0afe903c54cd85cb176.tar.xz python-github3-4dbd53a7b438d9d7b13bc0afe903c54cd85cb176.zip |
WIP on resources.users tests
Diffstat (limited to '')
-rw-r--r-- | pygithub3/tests/services/test_users.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pygithub3/tests/services/test_users.py b/pygithub3/tests/services/test_users.py new file mode 100644 index 0000000..f2daa36 --- /dev/null +++ b/pygithub3/tests/services/test_users.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- + +from unittest import TestCase + +import requests +from mock import patch, Mock + +from pygithub3.services.users import User +from pygithub3.resources.base import json +from pygithub3.tests.utils.services import _, mock_json + +json.dumps = Mock(side_effect=mock_json) +json.loads = Mock(side_effect=mock_json) + +@patch.object(requests.sessions.Session, 'request') +class TestUserService(TestCase): + + def setUp(self): + self.us = User() + + def test_GET_without_user(self, request_method): + response = Mock(name='response') + response.content = {'dummy': 'dummy'} + request_method.return_value = response + self.us.get() + request_method.assert_called_with('get', _('user'), params={}) |