示例#1
0
class TestTreesService(TestCase):
    def setUp(self):
        self.service = Trees(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/user/repo/git/trees/abc123'))
        )

    def test_CREATE(self, reqm):
        reqm.return_value = mock_response('post')
        self.service.create({
            'tree': [
                {'path': 'foo.txt', 'mode': '100644', 'type': 'blob',
                 'sha': 'abc123'},
            ],
        })
        self.assertEqual(
            reqm.call_args[0],
            ('post', _('repos/user/repo/git/trees'))
        )
示例#2
0
 def setUp(self):
     self.service = Trees(user='******', repo='repo')