Exemple #1
0
 def test_non(self):
     assert not all_are([1, "2", "3"], str)
     assert not all_are([1, [2], "3"], (list, tuple))
Exemple #2
0
 def test_equ(self):
     assert all_are([1, 2, 3], int)
     assert all_are([(1,), [2], (3, 4)], (list, tuple))
Exemple #3
0
 def fromList(self, ring):
     if not all_are(ring, (str, dict)):
         raise BudSyntaxError(
             'Unsupported mixed {}'.format(RingMaker.NM),
             RingMaker.KEYS)
     return ring
Exemple #4
0
 def fromList(self, ring):
     if not all_are(ring, (str, dict)):
         raise BudSyntaxError('Unsupported mixed {}'.format(RingMaker.NM),
                              RingMaker.KEYS)
     return ring
Exemple #5
0
 def fromList(self, layer):
     if not all_are(layer, (list, dict)):
         raise BudSyntaxError(
             'Unsupported mixed {}'.format(SliceMaker.NM),
             SliceMaker.KEYS)
     return layer