Reuse helper in all tests
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
8d224b206b
commit
652987f2cc
@ -11,7 +11,7 @@ import sys
|
|||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
||||||
|
|
||||||
from pungi.phases.image_build import ImageBuildPhase, CreateImageBuildThread
|
from pungi.phases.image_build import ImageBuildPhase, CreateImageBuildThread
|
||||||
from tests.helpers import DummyCompose, PungiTestCase
|
from tests.helpers import DummyCompose, PungiTestCase, boom
|
||||||
|
|
||||||
|
|
||||||
class TestImageBuildPhase(PungiTestCase):
|
class TestImageBuildPhase(PungiTestCase):
|
||||||
@ -580,9 +580,6 @@ class TestCreateImageBuildThread(PungiTestCase):
|
|||||||
'scratch': False,
|
'scratch': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
def boom(*args, **kwargs):
|
|
||||||
raise RuntimeError('BOOM')
|
|
||||||
|
|
||||||
koji_wrapper = KojiWrapper.return_value
|
koji_wrapper = KojiWrapper.return_value
|
||||||
koji_wrapper.run_blocking_cmd.side_effect = boom
|
koji_wrapper.run_blocking_cmd.side_effect = boom
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import sys
|
|||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
||||||
|
|
||||||
from pungi.phases.live_images import LiveImagesPhase, CreateLiveImageThread
|
from pungi.phases.live_images import LiveImagesPhase, CreateLiveImageThread
|
||||||
from tests.helpers import DummyCompose, PungiTestCase
|
from tests.helpers import DummyCompose, PungiTestCase, boom
|
||||||
|
|
||||||
|
|
||||||
class TestLiveImagesPhase(PungiTestCase):
|
class TestLiveImagesPhase(PungiTestCase):
|
||||||
@ -621,9 +621,6 @@ class TestCreateLiveImageThread(PungiTestCase):
|
|||||||
'subvariant': 'Client',
|
'subvariant': 'Client',
|
||||||
}
|
}
|
||||||
|
|
||||||
def boom(*args, **kwargs):
|
|
||||||
raise RuntimeError('BOOM')
|
|
||||||
|
|
||||||
koji_wrapper = KojiWrapper.return_value
|
koji_wrapper = KojiWrapper.return_value
|
||||||
koji_wrapper.get_create_image_cmd.side_effect = boom
|
koji_wrapper.get_create_image_cmd.side_effect = boom
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import os
|
|||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
||||||
|
|
||||||
from pungi.phases.livemedia_phase import LiveMediaPhase, LiveMediaThread
|
from pungi.phases.livemedia_phase import LiveMediaPhase, LiveMediaThread
|
||||||
from tests.helpers import DummyCompose, PungiTestCase
|
from tests.helpers import DummyCompose, PungiTestCase, boom
|
||||||
|
|
||||||
|
|
||||||
class TestLiveMediaPhase(PungiTestCase):
|
class TestLiveMediaPhase(PungiTestCase):
|
||||||
@ -442,9 +442,6 @@ class TestLiveMediaThread(PungiTestCase):
|
|||||||
}
|
}
|
||||||
pool = mock.Mock()
|
pool = mock.Mock()
|
||||||
|
|
||||||
def boom(*args, **kwargs):
|
|
||||||
raise Exception('BOOM')
|
|
||||||
|
|
||||||
run_blocking_cmd = KojiWrapper.return_value.run_blocking_cmd
|
run_blocking_cmd = KojiWrapper.return_value.run_blocking_cmd
|
||||||
run_blocking_cmd.side_effect = boom
|
run_blocking_cmd.side_effect = boom
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user