コード例 #1
0
 def test_destabilize_pathsuccess_0(self):
     """Should return True if
     Cond1 and Cond2 are satisfied
     and should modifiy word and genCount"""
     bw = BraidWord([-1, 2, 3])  # Check absval of genCount with -1
     self.assertTrue(bw.destabilize())
     # Word modifications
     self.assertEqual(bw.word, [-1, 2])
     # genCount modification
     self.assertEqual(bw.genCount, [1, 1])
コード例 #2
0
 def test_destabilize_pathfail_1(self):
     """Should return False if
     Cond2:
     one largestGenerator exists but not at end
     and should not modify word or genCount"""
     bw = BraidWord([1, 3, 2])
     self.assertFalse(bw.destabilize())
     # (No) Word modification
     self.assertEqual(bw.word, [1, 3, 2])
     # (No) genCount modification
     self.assertEqual(bw.genCount, [1, 1, 1])