def test_src_build_failed(): """ Tests whether a sourcebuild was set to failed correctly """ src_build = Build(buildtype="source") src_build.parent = Build(buildtype="build") logmock(src_build) loop = asyncio.get_event_loop() loop.run_until_complete(src_build.set_failed()) assert src_build.buildstate == "build_failed" assert src_build.parent.buildstate == "build_failed"
def test_deb_build_failed(): """ Tests whether a debian build was set to failed correctly """ deb_build = Build(buildtype="deb") deb_build.parent = Build(buildtype="source") deb_build.parent.parent = Build(buildtype="build") logmock(deb_build) loop = asyncio.get_event_loop() loop.run_until_complete(deb_build.set_failed()) assert deb_build.buildstate == "build_failed" assert deb_build.parent.parent.buildstate == "build_failed"
def test_src_build_failed(): """ Tests whether a sourcebuild was set to failed correctly """ src_build = Build(buildtype="source") src_build.parent = Build(buildtype="build") src_build.log_state = MagicMock() src_build.parent.log_state = MagicMock() with patch("molior.molior.buildlogger.write_log"), \ patch("molior.molior.buildlogger.write_log_title"): loop = asyncio.get_event_loop() loop.run_until_complete(src_build.set_failed()) assert src_build.buildstate == "build_failed" assert src_build.parent.buildstate == "build_failed"