Пример #1
0
class TestCommitsService(TestCase):
    def setUp(self):
        self.service = Commits(user='******', repo='repo')

    def test_GET(self, reqm):
        reqm.return_value = mock_response()
        self.service.get('abc123')
        self.assertEqual(
            reqm.call_args[0],
            ('get', _('repos/octocat/repo/git/commits/abc123'))
        )

    def test_CREATE(self, reqm):
        reqm.return_value = mock_response('post')
        self.service.create({
            'message': 'hello',
            'tree': 'abc123',
            'parents': ['mom', 'dad'],
        })
        self.assertEqual(
            reqm.call_args[0],
            ('post', _('repos/octocat/repo/git/commits'))
        )
Пример #2
0
 def setUp(self):
     self.service = Commits(user='******', repo='repo')