Пример #1
0
 def zpartner(self):
     """
     Property that returns the Z-partner of the given object if it exists,
     otherwise returns None.
     """
     if self._mod == 12:
         zint = Z_PARTNERS.get(self.pcint, None)
         if zint:
             return self.copy(utils.fromint(zint))
         else:
             return
     for each in self.each_card():
         if each.icv == self.icv:
             if each.prime._unique_pcs != self.prime._unique_pcs:
                 return self.copy(each)
Пример #2
0
 def testZPartner(self):
     for each in self.make_z_sets():
         self.assertTrue(each.zpartner.pcint in Z_PARTNERS.values())
Пример #3
0
 def testZ(self):
     for each in self.make_z_sets():
         each.z()
         self.assertTrue(each.pcint in Z_PARTNERS.values())
Пример #4
0
 def make_z_sets(self):
     zints = Z_PARTNERS.keys()
     return [PCSet(utils.fromint(zint)) for zint in zints]