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')))
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')))
def setUp(self): self.ev = Events(user='******', repo='Hello-World')