Unify error messages for CLI Unify error messages for hub Fixes: https://pagure.io/koji/issue/2720
21 lines
606 B
Python
21 lines
606 B
Python
import unittest
|
|
|
|
import koji
|
|
import kojihub
|
|
|
|
|
|
class TestSearch(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
self.exports = kojihub.RootExports()
|
|
|
|
def test_empty_terms(self):
|
|
with self.assertRaises(koji.GenericError) as cm:
|
|
self.exports.search('', 'type', 'glob')
|
|
self.assertEqual("empty search terms", str(cm.exception))
|
|
|
|
def test_wrong_type(self):
|
|
type = 'test-type'
|
|
with self.assertRaises(koji.GenericError) as cm:
|
|
self.exports.search('item', type, 'glob')
|
|
self.assertEqual("No such search type: %s" % type, str(cm.exception))
|