Get the test suite working again.
This commit is contained in:
parent
16fdb3b14e
commit
3a1972e8da
4 changed files with 13 additions and 4 deletions
|
|
@ -11,7 +11,7 @@ class TestDeleteBuild(unittest.TestCase):
|
|||
@mock.patch('kojihub.context')
|
||||
@mock.patch('kojihub.get_build')
|
||||
def test_delete_build_raise_error(self, build, context):
|
||||
|
||||
context.session.assertPerm = mock.MagicMock()
|
||||
references = ['tags', 'rpms', 'archives', 'images']
|
||||
for ref in references:
|
||||
context = mock.MagicMock()
|
||||
|
|
@ -27,7 +27,7 @@ class TestDeleteBuild(unittest.TestCase):
|
|||
@mock.patch('kojihub.context')
|
||||
@mock.patch('kojihub.get_build')
|
||||
def test_delete_build_return_false(self, build, context):
|
||||
|
||||
context.session.assertPerm = mock.MagicMock()
|
||||
references = ['tags', 'rpms', 'archives', 'images']
|
||||
for ref in references:
|
||||
context = mock.MagicMock()
|
||||
|
|
@ -42,7 +42,7 @@ class TestDeleteBuild(unittest.TestCase):
|
|||
@mock.patch('kojihub.context')
|
||||
@mock.patch('kojihub.get_build')
|
||||
def test_delete_build_check_last_used_raise_error(self, build, context):
|
||||
|
||||
context.session.assertPerm = mock.MagicMock()
|
||||
references = ['tags', 'rpms', 'archives', 'images', 'last_used']
|
||||
for ref in references:
|
||||
context = mock.MagicMock()
|
||||
|
|
@ -59,7 +59,7 @@ class TestDeleteBuild(unittest.TestCase):
|
|||
@mock.patch('kojihub.context')
|
||||
@mock.patch('kojihub.get_build')
|
||||
def test_delete_build_check_last_used_raise_error(self, build, context):
|
||||
|
||||
context.session.assertPerm = mock.MagicMock()
|
||||
references = ['tags', 'rpms', 'archives', 'images', 'last_used']
|
||||
for ref in references:
|
||||
context = mock.MagicMock()
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ class TestImportImageInternal(unittest.TestCase):
|
|||
@mock.patch('kojihub.Task')
|
||||
@mock.patch('kojihub.context')
|
||||
def test_basic(self, context, Task, get_build, get_archive_type, import_archive, work):
|
||||
task = mock.MagicMock()
|
||||
task.assertHost = mock.MagicMock()
|
||||
Task.return_value = task
|
||||
imgdata = {
|
||||
'arch': 'x86_64',
|
||||
'task_id': 1,
|
||||
|
|
@ -51,6 +54,9 @@ class TestImportImageInternal(unittest.TestCase):
|
|||
@mock.patch('kojihub.Task')
|
||||
@mock.patch('kojihub.context')
|
||||
def test_with_rpm(self, context, Task, get_build, get_archive_type, import_archive, build, work, get_rpm):
|
||||
task = mock.MagicMock()
|
||||
task.assertHost = mock.MagicMock()
|
||||
Task.return_value = task
|
||||
rpm = {
|
||||
#'location': 'foo',
|
||||
'id': 6,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class TestInsertProcessor(unittest.TestCase):
|
|||
def test_make_create(self, context):
|
||||
cursor = mock.MagicMock()
|
||||
context.cnx.cursor.return_value = cursor
|
||||
context.session.assertLogin = mock.MagicMock()
|
||||
proc = kojihub.InsertProcessor('sometable', data={'foo': 'bar'})
|
||||
proc.make_create(event_id=1, user_id=2)
|
||||
self.assertEquals(proc.data['create_event'], 1)
|
||||
|
|
@ -54,6 +55,7 @@ class TestInsertProcessor(unittest.TestCase):
|
|||
def test_dup_check(self, context):
|
||||
cursor = mock.MagicMock()
|
||||
context.cnx.cursor.return_value = cursor
|
||||
context.session.assertLogin = mock.MagicMock()
|
||||
proc = kojihub.InsertProcessor('sometable', data={'foo': 'bar'})
|
||||
proc.dup_check()
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class TestRunrootHub(unittest.TestCase):
|
|||
@mock.patch('kojihub.make_task')
|
||||
@mock.patch('runroot_hub.context')
|
||||
def test_basic_invocation(self, context, make_task):
|
||||
context.session.assertPerm = mock.MagicMock()
|
||||
runroot_hub.runroot(
|
||||
tagInfo='some_tag',
|
||||
arch='x86_64',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue