def test_pop_back(self): ''' Must make the image with next smaller index active when the active is poped''' chain.Insert_Image_Before(self.p_state) # add before active self.assertEqual(system.Get_Index(self.p_state), 1) # active is 1st chain.Pop_Back(self.p_state) # delete the last (active) self.assertEqual(system.Get_Index(self.p_state), 0) # active is 0th self.assertEqual(chain.Get_NOI(self.p_state), 1) # total 1 image
def tearDown(self): ''' clean the p_state ''' noi = chain.Get_NOI(self.p_state) for i in range(noi - 1): chain.Pop_Back(self.p_state) self.assertEqual(chain.Get_NOI(self.p_state), 1)