def testSanity(self): """ConvertIp2P(ConvertP2Ip(n))==n for all n""" for lvlnew,lvlold,ipnew,ipold,kind in self.knownValues: (lvl2,kind2) = Fstdc.ConvertIp2P(ipnew,Fstdc.CONVIP_IP2P_DEFAULT) ipnew2 = Fstdc.ConvertP2Ip(lvl2,kind2,Fstdc.CONVIP_STYLE_NEW) self.assertEqual(ipnew2,ipnew)
def testConvertIp2PKnownValues(self): """ConvertIp2P should give known result with known input""" for lvlnew,lvlold,ipnew,ipold,kind in self.knownValues: (lvl2,kind2) = Fstdc.ConvertIp2P(ipnew,Fstdc.CONVIP_IP2P_DEFAULT) self.assertEqual(kind2,kind) self.assertAlmostEqual(lvlnew,lvl2,6)