Commit 4fb1b928 authored by Alex Willmer's avatar Alex Willmer Committed by David Wilson

Adjust unittest for master -> parent split

Tests should now match changes in
4d31300dd09ae7aaa394e53a48102167521f3f91
parent 9ccff0f5
import mitogen.core import mitogen.core
import mitogen.master import mitogen.parent
@mitogen.core.takes_econtext @mitogen.core.takes_econtext
def allocate_an_id(econtext): def allocate_an_id(econtext):
mitogen.master.upgrade_router(econtext) mitogen.parent.upgrade_router(econtext)
return econtext.router.allocate_id() return econtext.router.allocate_id()
...@@ -3,7 +3,7 @@ import subprocess ...@@ -3,7 +3,7 @@ import subprocess
import unittest2 import unittest2
import mitogen.master import mitogen.parent
import testlib import testlib
...@@ -17,7 +17,7 @@ class CommandLineTest(testlib.RouterMixin, testlib.TestCase): ...@@ -17,7 +17,7 @@ class CommandLineTest(testlib.RouterMixin, testlib.TestCase):
# * 3.x starting 2.7 # * 3.x starting 2.7
def test_valid_syntax(self): def test_valid_syntax(self):
stream = mitogen.master.Stream(self.router, 0) stream = mitogen.parent.Stream(self.router, 0)
args = stream.get_boot_command() args = stream.get_boot_command()
# Executing the boot command will print "EC0" and expect to read from # Executing the boot command will print "EC0" and expect to read from
......
...@@ -6,6 +6,7 @@ import unittest2 ...@@ -6,6 +6,7 @@ import unittest2
import testlib import testlib
import mitogen.master import mitogen.master
import mitogen.parent
class ScanCodeImportsTest(unittest2.TestCase): class ScanCodeImportsTest(unittest2.TestCase):
...@@ -19,11 +20,12 @@ class ScanCodeImportsTest(unittest2.TestCase): ...@@ -19,11 +20,12 @@ class ScanCodeImportsTest(unittest2.TestCase):
(-1, 'unittest2', ()), (-1, 'unittest2', ()),
(-1, 'testlib', ()), (-1, 'testlib', ()),
(-1, 'mitogen.master', ()), (-1, 'mitogen.master', ()),
(-1, 'mitogen.parent', ()),
]) ])
class IterReadTest(unittest2.TestCase): class IterReadTest(unittest2.TestCase):
func = staticmethod(mitogen.master.iter_read) func = staticmethod(mitogen.parent.iter_read)
def make_proc(self): def make_proc(self):
args = [testlib.data_path('iter_read_generator.sh')] args = [testlib.data_path('iter_read_generator.sh')]
...@@ -75,7 +77,7 @@ class IterReadTest(unittest2.TestCase): ...@@ -75,7 +77,7 @@ class IterReadTest(unittest2.TestCase):
class WriteAllTest(unittest2.TestCase): class WriteAllTest(unittest2.TestCase):
func = staticmethod(mitogen.master.write_all) func = staticmethod(mitogen.parent.write_all)
def make_proc(self): def make_proc(self):
args = [testlib.data_path('write_all_consumer.sh')] args = [testlib.data_path('write_all_consumer.sh')]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment