def setUp(self): self.tape = Recorder() set_recorder(self.tape) p = Parent() c = Child() toy = Toy(color='blue', type='bunny') c.toy = toy p.children.append(c) self.p = p return
def test_recorder_and_ignored(self): "Test if recorder trait is set and private traits are ignored." t = Test() self.assertEqual(t.recorder, None) self.assertEqual(t._ignore, False) self.assertEqual(t.ignore_, False) tape = Recorder() tape.register(t) tape.recording = True self.assertEqual(t.recorder, tape) t._ignore = True t.ignore_ = True self.assertEqual(len(tape.script.strip()), 0)
def setUp(self): tape = Recorder() # Set the global recorder. set_recorder(tape) self.tape = tape