2017-09-21 09:56:56 +00:00
|
|
|
|
2017-11-12 12:42:27 +00:00
|
|
|
import unittest2
|
2017-09-21 09:56:56 +00:00
|
|
|
|
|
|
|
import testlib
|
|
|
|
import mitogen.master
|
|
|
|
|
|
|
|
|
2017-11-12 12:42:27 +00:00
|
|
|
class ScanCodeImportsTest(unittest2.TestCase):
|
2017-09-30 08:25:41 +00:00
|
|
|
func = staticmethod(mitogen.master.scan_code_imports)
|
|
|
|
|
|
|
|
def test_simple(self):
|
|
|
|
co = compile(open(__file__).read(), __file__, 'exec')
|
|
|
|
self.assertEquals(list(self.func(co)), [
|
2017-11-11 22:59:38 +00:00
|
|
|
(-1, 'unittest2', ()),
|
2017-09-30 08:25:41 +00:00
|
|
|
(-1, 'testlib', ()),
|
|
|
|
(-1, 'mitogen.master', ()),
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2017-11-12 12:42:27 +00:00
|
|
|
unittest2.main()
|