Ejemplo n.º 1
0
 def testLevels_to_ip1KnownValues(self):
     """levels_to_ip1 should give known result with known input"""
     for lvlnew,lvlold,ipnew,ipold,kind in self.knownValues:
         (ipnew2,ipold2) = rpnstd.levels_to_ip1([lvlnew],kind)[0]
         self.assertEqual(ipnew2,ipnew)
         (ipnew2,ipold2) = rpnstd.levels_to_ip1([lvlold],kind)[0]
         self.assertEqual(ipold2,ipold)
Ejemplo n.º 2
0
 def testLevels_to_ip1KnownValues(self):
     """levels_to_ip1 should give known result with known input"""
     for lvlnew,lvlold,ipnew,ipold,kind in self.knownValues:
         (ipnew2,ipold2) = rpnstd.levels_to_ip1([lvlnew],kind)[0]
         self.assertEqual(ipnew2,ipnew)
         (ipnew2,ipold2) = rpnstd.levels_to_ip1([lvlold],kind)[0]
         self.assertEqual(ipold2,ipold)
Ejemplo n.º 3
0
 def testSanity(self):
     """levels_to_ip1(ip1_to_levels(n))==n for all n"""
     for lvlnew,lvlold,ipnew,ipold,kind in self.knownValues:
         (lvl2,kind2) = rpnstd.ip1_to_levels([ipnew])[0]
         (ipnew2,ipold2) = rpnstd.levels_to_ip1([lvl2],kind2)[0]
         self.assertEqual(ipnew2,ipnew)
         (lvl2,kind2) = rpnstd.ip1_to_levels([ipold])[0]
         (ipnew2,ipold2) = rpnstd.levels_to_ip1([lvl2],kind2)[0]
         self.assertEqual(ipold2,ipold)
Ejemplo n.º 4
0
 def testSanity(self):
     """levels_to_ip1(ip1_to_levels(n))==n for all n"""
     for lvlnew,lvlold,ipnew,ipold,kind in self.knownValues:
         (lvl2,kind2) = rpnstd.ip1_to_levels([ipnew])[0]
         (ipnew2,ipold2) = rpnstd.levels_to_ip1([lvl2],kind2)[0]
         self.assertEqual(ipnew2,ipnew)
         (lvl2,kind2) = rpnstd.ip1_to_levels([ipold])[0]
         (ipnew2,ipold2) = rpnstd.levels_to_ip1([lvl2],kind2)[0]
         self.assertEqual(ipold2,ipold)