def testRebuild(self): """Rebuilding an unchanged module.""" # This test would actually pass if rebuild was a no-op, but it # ensures rebuild doesn't break stuff while being a less # complex test than testFileRebuild. x = crash_test_dummy.X('a') rebuild.rebuild(crash_test_dummy, doLog=False) # Instance rebuilding is triggered by attribute access. x.do() self.failUnlessIdentical(x.__class__, crash_test_dummy.X) self.failUnlessIdentical(f, crash_test_dummy.foo)
def testRebuild(self): x = crash_test_dummy.X('a') x = [x] d = delay.Delayed() d.later(x[0].do, 1) d.run() d.run() d.run() d.later(x[0].do, 1) rebuild(crash_test_dummy,0) d.run() d.run() d.run() rebuild(thing,0) rebuild(server,0) assert f is crash_test_dummy.foo, 'huh?' #x[0].do() assert x[0].__class__ is crash_test_dummy.X, 'huh?'