aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/tests
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2012-02-22 01:16:10 +0100
committerDavid Medina <davidmedina9@gmail.com>2012-02-22 01:16:32 +0100
commit36381d426f5da0552d2db0b60c757ef5e3a67c2d (patch)
treee5dc0081cbb3cc67655f45ee217ebf7165dc0fa2 /pygithub3/tests
parentRepos.downloads service done (diff)
downloadpython-github3-36381d426f5da0552d2db0b60c757ef5e3a67c2d.tar.xz
python-github3-36381d426f5da0552d2db0b60c757ef5e3a67c2d.zip
Repos.forks service done
Diffstat (limited to 'pygithub3/tests')
-rw-r--r--pygithub3/tests/services/test_repos.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/pygithub3/tests/services/test_repos.py b/pygithub3/tests/services/test_repos.py
index 615f883..f8392b5 100644
--- a/pygithub3/tests/services/test_repos.py
+++ b/pygithub3/tests/services/test_repos.py
@@ -6,7 +6,8 @@ from unittest import TestCase
import requests
from mock import patch, Mock
-from pygithub3.services.repos import Repo, Collaborator, Commits, Downloads
+from pygithub3.services.repos import (Repo, Collaborator, Commits, Downloads,
+ Forks)
from pygithub3.resources.base import json
from pygithub3.tests.utils.base import (mock_response, mock_response_result,
mock_json)
@@ -268,3 +269,22 @@ class TestDownloadsService(TestCase):
self.assertEqual(request_method.call_args[0],
('post', _('repos/oct/re_oct/downloads')))
self.assertTrue(hasattr(download, 'upload'))
+
+
+@patch.object(requests.sessions.Session, 'request')
+class TestForksService(TestCase):
+
+ def setUp(self):
+ self.fs = Forks(user='oct', repo='re_oct')
+
+ def test_LIST(self, request_method):
+ request_method.return_value = mock_response_result()
+ self.fs.list().all()
+ self.assertEqual(request_method.call_args[0],
+ ('get', _('repos/oct/re_oct/forks')))
+
+ def test_CREATE(self, request_method):
+ request_method.return_value = mock_response('post')
+ self.fs.create()
+ self.assertEqual(request_method.call_args[0],
+ ('post', _('repos/oct/re_oct/forks')))