def test_cancel_pathsuccess(self): """Should successfully cancel gen @idx 3 and should modify word""" bw = BraidWord([-1, 2, 3, 1]) # Execution path True self.assertTrue(bw.cancel(3)) # Word modification self.assertEqual(bw.word, [2, 3])
def test_cancel_pathfail(self): """Should return False and fail to cancel gen @idx 1 and not modify word""" bw = BraidWord([-1, 2, 3, 1]) # Execution path False self.assertFalse(bw.cancel(1)) # (No) Word modification self.assertEqual(bw.word, [-1, 2, 3, 1])