(self)
Test that the binary partitions are generated correctly.
Test that the binary partitions are generated correctly.
Test that the binary partitions are generated correctly .
def testBinary(self):
        """Test that the binary partitions are generated correctly."""
        for n in range(len(self.counts)):
            binaries = []
            for p in partitions(n):
                for x in p:
                    if x & (x - 1):
                        break
                else:
                    binaries.append(list(p))
            self.assertEqual(binaries,[list(p) for p in binary_partitions(n)])
def testBinary ( self ) : for n in range ( len ( self . counts ) ) : binaries = [ ] for p in partitions ( n ) : for x in p : if x & ( x - 1 ) : break else : binaries . append ( list ( p ) ) self . assertEqual ( binaries , [ list ( p ) for p in binary_partitions ( n ) ] )