core: loosen assertion to allow fakessh_test to succeed.
This commit is contained in:
parent
bc801bc2ed
commit
2454dcc990
|
@ -763,7 +763,7 @@ class Context(object):
|
||||||
def _unpickle_context(router, context_id, name):
|
def _unpickle_context(router, context_id, name):
|
||||||
assert isinstance(router, Router)
|
assert isinstance(router, Router)
|
||||||
assert isinstance(context_id, (int, long)) and context_id > 0
|
assert isinstance(context_id, (int, long)) and context_id > 0
|
||||||
assert type(name) is str and len(name) < 100
|
assert isinstance(name, basestring) and len(name) < 100
|
||||||
return Context(router, context_id, name)
|
return Context(router, context_id, name)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import mitogen.master
|
||||||
|
|
||||||
|
|
||||||
|
class CompilerModuleTest(unittest.TestCase):
|
||||||
|
klass = mitogen.master.ModuleScanner
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
super(CompilerModuleTest, cls).setUpClass()
|
||||||
|
#import compiler
|
||||||
|
#mitogen.master.ast = None
|
||||||
|
#mitogen.master.compiler = compiler
|
||||||
|
|
||||||
|
def test_simple(self):
|
||||||
|
for x in range(100):
|
||||||
|
finder = self.klass()
|
||||||
|
from pprint import pprint
|
||||||
|
import time
|
||||||
|
t0 = time.time()
|
||||||
|
import mitogen.fakessh
|
||||||
|
pprint(finder.find_related('mitogen.fakessh'))
|
||||||
|
print 1000 * (time.time() - t0)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
Loading…
Reference in New Issue