| |
@@ -357,6 +357,28 @@
|
| |
|
| |
class BaseTestBuild:
|
| |
|
| |
+ @classmethod
|
| |
+ def setup_class(cls):
|
| |
+ # Do not really build module-build-macros SRPM
|
| |
+ # get_disttag_rpm builds package module-build-macros by `rpmbuild -bs'
|
| |
+ # and return the path of result SRPM.
|
| |
+
|
| |
+ cls.p_Popen = patch("subprocess.Popen")
|
| |
+ cls.mock_Popen = cls.p_Popen.start()
|
| |
+ cls.mock_Popen.return_value.returncode = 0
|
| |
+ cls.mock_Popen.return_value.communicate.return_value = ('', '')
|
| |
+
|
| |
+ # Let get_disttag_rpm return a fake SRPM path
|
| |
+ cls.p_glob = patch(
|
| |
+ "glob.glob",
|
| |
+ return_value=["/tmp/module-build/module-build-macros.src.rpm"])
|
| |
+ cls.mock_glob = cls.p_glob.start()
|
| |
+
|
| |
+ @classmethod
|
| |
+ def teardown_class(cls):
|
| |
+ cls.p_glob.stop()
|
| |
+ cls.p_Popen.stop()
|
| |
+
|
| |
def run_scheduler(self, db_session, msgs=None, stop_condition=None):
|
| |
module_build_service.scheduler.main(
|
| |
msgs or [],
|
| |
Signed-off-by: Chenxiong Qi cqi@redhat.com