Ejemplo n.º 1
0
class TestEventsService(TestCase):

    def setUp(self):
        self.ev = Events(user='******', repo='Hello-World')

    def test_LIST_by_issue(self, request_method):
        request_method.return_value = mock_response_result()
        self.ev.list_by_issue(1).all()
        self.assertEqual(request_method.call_args[0],
            ('get', _('repos/octocat/Hello-World/issues/1/events')))

    def test_LIST_by_repo(self, request_method):
        request_method.return_value = mock_response_result()
        self.ev.list_by_repo().all()
        self.assertEqual(request_method.call_args[0],
            ('get', _('repos/octocat/Hello-World/issues/events')))

    def test_GET(self, request_method):
        request_method.return_value = mock_response()
        self.ev.get(1)
        self.assertEqual(request_method.call_args[0],
            ('get', _('repos/octocat/Hello-World/issues/events/1')))
Ejemplo n.º 2
0
class TestEventsService(TestCase):
    def setUp(self):
        self.ev = Events(user='******', repo='Hello-World')

    def test_LIST_by_issue(self, request_method):
        request_method.return_value = mock_response_result()
        self.ev.list_by_issue(1).all()
        self.assertEqual(
            request_method.call_args[0],
            ('get', _('repos/octocat/Hello-World/issues/1/events')))

    def test_LIST_by_repo(self, request_method):
        request_method.return_value = mock_response_result()
        self.ev.list_by_repo().all()
        self.assertEqual(request_method.call_args[0],
                         ('get', _('repos/octocat/Hello-World/issues/events')))

    def test_GET(self, request_method):
        request_method.return_value = mock_response()
        self.ev.get(1)
        self.assertEqual(
            request_method.call_args[0],
            ('get', _('repos/octocat/Hello-World/issues/events/1')))
Ejemplo n.º 3
0
 def setUp(self):
     self.ev = Events(user='******', repo='Hello-World')
Ejemplo n.º 4
0
 def setUp(self):
     self.ev = Events(user='******', repo='Hello-World')