Unify error messages for CLI Unify error messages for hub Fixes: https://pagure.io/koji/issue/2720
20 lines
556 B
Python
20 lines
556 B
Python
import unittest
|
|
|
|
import mock
|
|
|
|
import koji
|
|
import kojihub
|
|
|
|
|
|
class TestGetExternalRepo(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
self.get_external_repos = mock.patch('kojihub.get_external_repos').start()
|
|
self.exports = kojihub.RootExports()
|
|
|
|
def test_non_exist_repo(self):
|
|
repo = 'test-repo'
|
|
self.get_external_repos.return_value = []
|
|
with self.assertRaises(koji.GenericError) as cm:
|
|
self.exports.getExternalRepo(repo, strict=True)
|
|
self.assertEqual("No such repo: %s" % repo, str(cm.exception))
|