This commit is contained in:
Tomas Kopecek 2022-12-08 10:04:31 +01:00
parent 4916b368a5
commit 556dddc9d0
4 changed files with 10 additions and 10 deletions

View file

@ -24,7 +24,7 @@ class TestAddArchiveType(unittest.TestCase):
self.insert_execute = mock.MagicMock()
self.verify_name_internal = mock.patch('kojihub.kojihub.verify_name_internal').start()
self.get_archive_type = mock.patch('kojihub.kojihub.get_archive_type').start()
self.QueryProcessor = mock.patch('kojihub.QueryProcessor',
self.QueryProcessor = mock.patch('kojihub.kojihub.QueryProcessor',
side_effect=self.getQuery).start()
self.queries = []
self.query_execute = mock.MagicMock()

View file

@ -10,10 +10,10 @@ import kojihub
class TestCreateBuildTarget(unittest.TestCase):
def setUp(self):
self.get_build_targets = mock.patch('kojihub.get_build_targets').start()
self.get_tag = mock.patch('kojihub.get_tag').start()
self.verify_name_internal = mock.patch('kojihub.verify_name_internal').start()
self.context = mock.patch('kojihub.context').start()
self.get_build_targets = mock.patch('kojihub.kojihub.get_build_targets').start()
self.get_tag = mock.patch('kojihub.kojihub.get_tag').start()
self.verify_name_internal = mock.patch('kojihub.kojihub.verify_name_internal').start()
self.context = mock.patch('kojihub.kojihub.context').start()
# It seems MagicMock will not automatically handle attributes that
# start with "assert"
self.context.session.assertPerm = mock.MagicMock()

View file

@ -11,9 +11,9 @@ IP = kojihub.InsertProcessor
class TestCreateImageBuild(unittest.TestCase):
def setUp(self):
self.get_build = mock.patch('kojihub.get_build').start()
self.get_build = mock.patch('kojihub.kojihub.get_build').start()
self.exports = kojihub.RootExports()
self.InsertProcessor = mock.patch('kojihub.InsertProcessor',
self.InsertProcessor = mock.patch('kojihub.kojihub.InsertProcessor',
side_effect=self.getInsert).start()
self.inserts = []
self.insert_execute = mock.MagicMock()

View file

@ -11,13 +11,13 @@ IP = kojihub.InsertProcessor
class TestCreateMavenBuild(unittest.TestCase):
def setUp(self):
self.get_build = mock.patch('kojihub.get_build').start()
self.get_build = mock.patch('kojihub.kojihub.get_build').start()
self.exports = kojihub.RootExports()
self.session = mock.MagicMock()
self.context = mock.patch('kojihub.context').start()
self.context = mock.patch('kojihub.kojihub.context').start()
self.context_db = mock.patch('koji.db.context').start()
self.context.session.assertPerm = mock.MagicMock()
self.InsertProcessor = mock.patch('kojihub.InsertProcessor',
self.InsertProcessor = mock.patch('kojihub.kojihub.InsertProcessor',
side_effect=self.getInsert).start()
self.inserts = []
self.insert_execute = mock.MagicMock()