def test_get_reviews_get_repo_not_found(self, mock_get_repo): with self.assertRaises(Exception) as context: uname = test_mock.mock_get_user_(self.config['user_name']) GithubService().get_reviews(uname=uname, repo_name=self.config['repo_name']) msg = 'Repository %s not found for user %s' % (self.config['repo_name'], uname.login) self.assertTrue(msg in str(context.exception))
def test_get_reviews_get_repo(self, mock_get_pulls, mock_get_repo_): uname = test_mock.mock_get_user_(self.config['user_name']) res = GithubService().get_reviews(uname=uname, repo_name=self.config['repo_name']) self.assertEqual(res, [])