From: Zac Medico Date: Mon, 16 Aug 2010 16:08:00 +0000 (-0700) Subject: Test the EbuildPhase class. X-Git-Tag: v2.2_rc68~154 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5410d3b3fa536f305867a09a6ab640085ef6d0a0;p=portage.git Test the EbuildPhase class. --- diff --git a/pym/portage/tests/ebuild/test_doebuild_spawn.py b/pym/portage/tests/ebuild/test_doebuild_spawn.py index 842bb45f0..506a6d185 100644 --- a/pym/portage/tests/ebuild/test_doebuild_spawn.py +++ b/pym/portage/tests/ebuild/test_doebuild_spawn.py @@ -9,7 +9,9 @@ from portage.package.ebuild.config import config from portage.package.ebuild.doebuild import spawn as doebuild_spawn from portage.tests import TestCase from portage.tests.resolver.ResolverPlayground import ResolverPlayground +from _emerge.EbuildPhase import EbuildPhase from _emerge.Package import Package +from _emerge.TaskScheduler import TaskScheduler class DoebuildSpawnTestCase(TestCase): """ @@ -53,5 +55,13 @@ class DoebuildSpawnTestCase(TestCase): "%s %s" % (_shell_quote(EBUILD_SH_BINARY), phase), settings, free=1) self.assertEqual(rval, os.EX_OK) + + task_scheduler = TaskScheduler() + ebuild_phase = EbuildPhase(background=True, + phase=phase, scheduler=task_scheduler.sched_iface, + settings=settings) + task_scheduler.add(ebuild_phase) + task_scheduler.run() + self.assertEqual(ebuild_phase.returncode, os.EX_OK) finally: playground.cleanup()