From 652987f2cc6656a0d035327279b89497c3960435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 22 Mar 2016 12:18:31 +0100 Subject: [PATCH] Reuse helper in all tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lubomír Sedlář --- tests/test_imagebuildphase.py | 5 +---- tests/test_liveimagesphase.py | 5 +---- tests/test_livemediaphase.py | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/test_imagebuildphase.py b/tests/test_imagebuildphase.py index bf3688b3..43fddff5 100755 --- a/tests/test_imagebuildphase.py +++ b/tests/test_imagebuildphase.py @@ -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 diff --git a/tests/test_liveimagesphase.py b/tests/test_liveimagesphase.py index 2b0a6664..a518f6d0 100755 --- a/tests/test_liveimagesphase.py +++ b/tests/test_liveimagesphase.py @@ -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 diff --git a/tests/test_livemediaphase.py b/tests/test_livemediaphase.py index d1dabda2..1237c723 100755 --- a/tests/test_livemediaphase.py +++ b/tests/test_livemediaphase.py @@ -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