def test_framecount(self): Conf.FRAME_TIME = ['t'] Conf.FLOW_DEF = [['def1']] f0 = AutoVivification({ 't': 2, 'def1': 1, 'unimportant': 1, }) f1 = AutoVivification({ 't': 0, 'def1': 1, 'unimportant': 1, }) f = Flow(f0) f.add_frame(f1) self.assertEqual(f.framecount, 2)
def test_frames_returns_copy(self): Conf.FRAME_TIME = ['t'] Conf.FLOW_DEF = [['def1']] f = Flow(AutoVivification({ 't': 0, 'def1': 1, 'unimportant': 1, })) f.add_frame(AutoVivification({ 't': 0, 'def1': 1, 'unimportant': 1, })) frames_before_add = f.frames f.frames['add'] = 'something' self.assertEqual( frames_before_add, f.frames, )
def test_newest_frame_time(self): Conf.FRAME_TIME = ['t'] Conf.FLOW_DEF = [['def1']] f0 = AutoVivification({ 't': 2, 'def1': 1, 'unimportant': 1, }) f1 = AutoVivification({ 't': 0, 'def1': 1, 'unimportant': 1, }) f2 = AutoVivification({ 't': 1, 'def1': 1, 'unimportant': 1, }) f = Flow(f0) f.add_frame(f1) f.add_frame(f2) self.assertEqual(f.newest_frame_time, f0['t'])