def testNormalized1(self): for i in xrange(0xFF): s = treesplit.split_as_string(i, 8, ".", "*")[::-1] r = paup.paup_group_to_mask(s, normalized=True) normalized = containers.NormalizedBitmaskDict.normalize(i, 0xFF) self.assertEqual(r, normalized, "%s => %s => %s" \ % (treesplit.split_as_string(i, 8), s, treesplit.split_as_string(normalized, 8)))
def testUnnormalized(self): for i in xrange(0xFF): s = treesplit.split_as_string(i, 8, ".", "*")[::-1] r = paup.paup_group_to_mask(s, normalized=False) self.assertEqual(r, i, "%s => %s => %s" \ % (treesplit.split_as_string(i, 8), s, treesplit.split_as_string(r, 8)))