':param composite_ring: a Ring instance
:param builders: a list of RingBuilder instances for assertion'

def assertDevices(self, composite_ring, builders):

    builder_devs = []
    for builder in builders:
        builder_devs.extend([(dev['ip'], dev['port'], dev['device']) for dev in builder._iter_devs()])
    got_devices = [(dev['ip'], dev['port'], dev['device']) for dev in composite_ring.devs if dev]
    self.assertEqual(sorted(builder_devs), sorted(got_devices), 'composite_ring    mismatched    with    part    of    the    rings')
    dev_ids = []
    for (i, dev) in enumerate(composite_ring.devs):
        if dev:
            self.assertEqual(i, dev['id'])
            dev_ids.append(dev['id'])
    self.assertEqual(len(builder_devs), len(dev_ids))
    def uniqueness(dev):
        return (dev['ip'], dev['port'], dev['device'])
    part_count = composite_ring.partition_count
    for part in range(part_count):
        primaries = [uniqueness(primary) for primary in composite_ring.get_part_nodes(part)]
        offset = 0
        for builder in builders:
            sub_primaries = [uniqueness(primary) for primary in builder.get_part_devices(part)]
            self.assertEqual(primaries[offset:(offset + builder.replicas)], sub_primaries, ('composite    ring    is    not    ordered    by    ring    order,    %s,    %s' % (primaries, sub_primaries)))
            offset += builder.replicas
