def test_transpose_pathfail(self): """Should return False if two adjacent generators have absolute values differing by 1 or less and should not transpose word.""" bw = BraidWord([1, 2, 3, -4]) # Checking absval with -4 self.assertFalse(bw.transpose(2)) # (No) Word modification self.assertEqual(bw.word, [1, 2, 3, -4])
def test_transpose_pathsuccess(self): """Should return True if two adjacent generators have absolute values differing by more than 1 and should successfully transpose word.""" bw = BraidWord([1, 2, 3, 4]) self.assertTrue( bw.transpose(3)) # Checking wrapping around with @idx 3 # Word modification self.assertEqual(bw.word, [4, 2, 3, 1])