aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/tests/services
diff options
context:
space:
mode:
Diffstat (limited to 'pygithub3/tests/services')
-rw-r--r--pygithub3/tests/services/test_repos.py17
-rw-r--r--pygithub3/tests/services/test_users.py27
2 files changed, 8 insertions, 36 deletions
diff --git a/pygithub3/tests/services/test_repos.py b/pygithub3/tests/services/test_repos.py
index fd15fe9..e77cc90 100644
--- a/pygithub3/tests/services/test_repos.py
+++ b/pygithub3/tests/services/test_repos.py
@@ -30,18 +30,12 @@ class TestRepoService(TestCase):
self.rs.list().all()
self.assertEqual(request_method.call_args[0], ('get', _('user/repos')))
- def test_LIST_with_user_in_args(self, request_method):
+ def test_LIST_with_user(self, request_method):
request_method.return_value = mock_response_result()
self.rs.list('octoc').all()
self.assertEqual(request_method.call_args[0],
('get', _('users/octoc/repos')))
- def test_LIST_with_user_in_service(self, request_method):
- request_method.return_value = mock_response_result()
- self.rs.list().all()
- self.assertEqual(request_method.call_args[0],
- ('get', _('users/octocat/repos')))
-
def test_LIST_filters(self, request_method):
request_method.return_value = mock_response_result()
self.rs.list('octoc', type='public').all()
@@ -340,14 +334,13 @@ class TestWatchersService(TestCase):
request_method.return_value = mock_response_result()
self.ws.list_repos().all()
self.assertEqual(request_method.call_args[0],
- ('get', _('users/oct/watched')))
+ ('get', _('user/watched')))
- def test_LIST_repos_without_user(self, request_method):
+ def test_LIST_repos_with_user(self, request_method):
request_method.return_value = mock_response_result()
- self.ws.set_user(None)
- self.ws.list_repos().all()
+ self.ws.list_repos('oct').all()
self.assertEqual(request_method.call_args[0],
- ('get', _('user/watched')))
+ ('get', _('users/oct/watched')))
def test_IS_watching(self, request_method):
request_method.return_value = mock_response()
diff --git a/pygithub3/tests/services/test_users.py b/pygithub3/tests/services/test_users.py
index f777d6d..317f0d5 100644
--- a/pygithub3/tests/services/test_users.py
+++ b/pygithub3/tests/services/test_users.py
@@ -28,19 +28,12 @@ class TestUserService(TestCase):
self.us.get()
self.assertEqual(request_method.call_args[0], ('get', _('user')))
- def test_GET_with_user_in_arg(self, request_method):
+ def test_GET_with_user(self, request_method):
request_method.return_value = mock_response()
self.us.get('octocat')
self.assertEqual(request_method.call_args[0],
('get', _('users/octocat')))
- def test_GET_with_user_in_service(self, request_method):
- request_method.return_value = mock_response()
- self.us.set_user('octocat_service')
- self.us.get()
- self.assertEqual(request_method.call_args[0],
- ('get', _('users/octocat_service')))
-
def test_UPDATE_with_valid_data(self, request_method):
request_method.return_value = mock_response('patch')
self.us.update({'name': 'dummy'})
@@ -101,38 +94,24 @@ class TestFollowersService(TestCase):
self.assertEqual(request_method.call_args[0],
('get', _('user/followers')))
- def test_LIST_with_user_in_arg(self, request_method):
+ def test_LIST_with_user(self, request_method):
request_method.return_value = mock_response_result()
self.fs.list('octocat').all()
self.assertEqual(request_method.call_args[0],
('get', _('users/octocat/followers')))
- def test_LIST_with_user_in_service(self, request_method):
- request_method.return_value = mock_response_result()
- self.fs.set_user('octocat_service')
- self.fs.list().all()
- self.assertEqual(request_method.call_args[0],
- ('get', _('users/octocat_service/followers')))
-
def test_LIST_FOLLOWING_without_user(self, request_method):
request_method.return_value = mock_response_result()
self.fs.list_following().all()
self.assertEqual(request_method.call_args[0],
('get', _('user/following')))
- def test_LIST_FOLLOWING_with_user_in_arg(self, request_method):
+ def test_LIST_FOLLOWING_with_user(self, request_method):
request_method.return_value = mock_response_result()
self.fs.list_following('octocat').all()
self.assertEqual(request_method.call_args[0],
('get', _('users/octocat/following')))
- def test_LIST_FOLLOWING_with_user_in_service(self, request_method):
- request_method.return_value = mock_response_result()
- self.fs.set_user('octocat_service')
- self.fs.list_following().all()
- self.assertEqual(request_method.call_args[0],
- ('get', _('users/octocat_service/following')))
-
def test_IS_FOLLOWING(self, request_method):
self.fs.is_following('octocat')
self.assertEqual(request_method.call_args[0],