Reuse helper in all tests

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-03-22 12:18:31 +01:00
parent 8d224b206b
commit 652987f2cc
3 changed files with 3 additions and 12 deletions

View File

@ -11,7 +11,7 @@ import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from pungi.phases.image_build import ImageBuildPhase, CreateImageBuildThread
from tests.helpers import DummyCompose, PungiTestCase
from tests.helpers import DummyCompose, PungiTestCase, boom
class TestImageBuildPhase(PungiTestCase):
@ -580,9 +580,6 @@ class TestCreateImageBuildThread(PungiTestCase):
'scratch': False,
}
def boom(*args, **kwargs):
raise RuntimeError('BOOM')
koji_wrapper = KojiWrapper.return_value
koji_wrapper.run_blocking_cmd.side_effect = boom

View File

@ -11,7 +11,7 @@ import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from pungi.phases.live_images import LiveImagesPhase, CreateLiveImageThread
from tests.helpers import DummyCompose, PungiTestCase
from tests.helpers import DummyCompose, PungiTestCase, boom
class TestLiveImagesPhase(PungiTestCase):
@ -621,9 +621,6 @@ class TestCreateLiveImageThread(PungiTestCase):
'subvariant': 'Client',
}
def boom(*args, **kwargs):
raise RuntimeError('BOOM')
koji_wrapper = KojiWrapper.return_value
koji_wrapper.get_create_image_cmd.side_effect = boom

View File

@ -10,7 +10,7 @@ import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from pungi.phases.livemedia_phase import LiveMediaPhase, LiveMediaThread
from tests.helpers import DummyCompose, PungiTestCase
from tests.helpers import DummyCompose, PungiTestCase, boom
class TestLiveMediaPhase(PungiTestCase):
@ -442,9 +442,6 @@ class TestLiveMediaThread(PungiTestCase):
}
pool = mock.Mock()
def boom(*args, **kwargs):
raise Exception('BOOM')
run_blocking_cmd = KojiWrapper.return_value.run_blocking_cmd
run_blocking_cmd.side_effect = boom