diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-09-05 12:20:47 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-09-05 12:20:47 -0700 |
commit | 19dd6a7f53ee6552a68e9f36d9be80b78bd44a68 (patch) | |
tree | e3f46ce64ddbe6b92cf3b2e141bb8dac4aa983e0 | |
parent | 8bb0f5400e8a642455a98d1b39a03fa3339fe511 (diff) | |
download | portage-19dd6a7f53ee6552a68e9f36d9be80b78bd44a68.tar.gz portage-19dd6a7f53ee6552a68e9f36d9be80b78bd44a68.tar.bz2 portage-19dd6a7f53ee6552a68e9f36d9be80b78bd44a68.zip |
Make PipeReaderTestCase use a PollScheduler instance directly since
TaskScheduler isn't really needed.
-rw-r--r-- | pym/portage/tests/process/test_poll.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pym/portage/tests/process/test_poll.py b/pym/portage/tests/process/test_poll.py index 579acf907..9df2e88ae 100644 --- a/pym/portage/tests/process/test_poll.py +++ b/pym/portage/tests/process/test_poll.py @@ -3,7 +3,7 @@ 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 @@ -18,22 +18,22 @@ class PipeReaderTestCase(TestCase): test_string = 2 * "blah blah blah\n" - 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=["bash", "-c", "echo -n '%s'" % test_string], 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') self.assertEqual(test_string, output) |