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