Commit 236d8341 authored by David Wilson's avatar David Wilson

Simple scan_code_imports test.

parent 6f5d4882
......@@ -7,6 +7,20 @@ import testlib
import mitogen.master
class ScanCodeImportsTest(unittest.TestCase):
func = staticmethod(mitogen.master.scan_code_imports)
def test_simple(self):
co = compile(open(__file__).read(), __file__, 'exec')
self.assertEquals(list(self.func(co)), [
(-1, 'subprocess', ()),
(-1, 'time', ()),
(-1, 'unittest', ()),
(-1, 'testlib', ()),
(-1, 'mitogen.master', ()),
])
class IterReadTest(unittest.TestCase):
func = staticmethod(mitogen.master.iter_read)
......@@ -96,3 +110,7 @@ class WriteAllTest(unittest.TestCase):
))
finally:
proc.terminate()
if __name__ == '__main__':
unittest.main()
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