summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-05 12:24:49 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-05 12:24:49 -0700
commitd4f0fba6d7a057358a3cfffc216108e6ca3aa53d (patch)
treea3c10260752b82b84903c7bf79c98603ba89c4b8
parent19dd6a7f53ee6552a68e9f36d9be80b78bd44a68 (diff)
downloadportage-d4f0fba6d7a057358a3cfffc216108e6ca3aa53d.tar.gz
portage-d4f0fba6d7a057358a3cfffc216108e6ca3aa53d.tar.bz2
portage-d4f0fba6d7a057358a3cfffc216108e6ca3aa53d.zip
Make LazyImportPortageBaselineTestCase use a PollScheduler instance
directly since TaskScheduler isn't really needed.
-rw-r--r--pym/portage/tests/lazyimport/test_lazy_import_portage_baseline.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pym/portage/tests/lazyimport/test_lazy_import_portage_baseline.py b/pym/portage/tests/lazyimport/test_lazy_import_portage_baseline.py
index d96f83a9b..f434573d0 100644
--- a/pym/portage/tests/lazyimport/test_lazy_import_portage_baseline.py
+++ b/pym/portage/tests/lazyimport/test_lazy_import_portage_baseline.py
@@ -6,7 +6,7 @@ import portage
from portage import os
from portage.tests import TestCase
-from _emerge.TaskScheduler import TaskScheduler
+from _emerge.PollScheduler import PollScheduler
from _emerge.PipeReader import PipeReader
from _emerge.SpawnProcess import SpawnProcess
@@ -30,23 +30,23 @@ class LazyImportPortageBaselineTestCase(TestCase):
Check what modules are imported by a baseline module import.
"""
- task_scheduler = TaskScheduler()
+ scheduler = PollScheduler().sched_iface
master_fd, slave_fd = os.pipe()
master_file = os.fdopen(master_fd, 'rb')
slave_file = os.fdopen(slave_fd, 'wb')
producer = SpawnProcess(
args=self._baseline_import_cmd,
env=os.environ, fd_pipes={1:slave_fd},
- scheduler=task_scheduler.sched_iface)
+ scheduler=scheduler)
producer.start()
slave_file.close()
consumer = PipeReader(
input_files={"producer" : master_file},
- scheduler=task_scheduler.sched_iface)
+ scheduler=scheduler)
- task_scheduler.add(consumer)
- task_scheduler.run()
+ consumer.start()
+ consumer.wait()
output = consumer.getvalue().decode('ascii', 'replace').split()
unexpected_modules = " ".join(sorted(x for x in output \