def test_get_issue(self): """Tests for _get_issue.""" # Simple case: get the existing issue from the existing repo. result = pss._get_issue(self.repo, "1") self.assertEqual(result.id, 1) # Issue that doesn't exist. six.assertRaisesRegex( self, PagureEvException, r"Issue '3' not found", pss._get_issue, self.repo, "3", ) # Private issue (for now we don't handle auth). six.assertRaisesRegex( self, PagureEvException, r"issue is private", pss._get_issue, self.repo, "2", ) # Issue from a project with no issue tracker. six.assertRaisesRegex( self, PagureEvException, r"No issue tracker found", pss._get_issue, self.repo2, "1", )