Revision af6d3b5d tools/test

b/tools/test
574 574
            l.sort()
575 575
            start = l.index(m) + 1
576 576
            end = start + limit
577
            end = len(l) >= end and end or len(l)
577
            end = end if len(l) >= end else len(l)
578 578
            self.assertEqual(objects, l[start:end])
579 579
    
580 580
    #takes too long
......
1176 1176
            hashes = body['hashes']
1177 1177
            block_size = body['block_size']
1178 1178
            block_hash = body['block_hash']
1179
            block_num = l/block_size == 0 and l/block_size or l/block_size + 1
1179
            block_num = l/block_size if l/block_size == 0 else l/block_size + 1
1180 1180
            self.assertTrue(len(hashes), block_num)
1181 1181
            i = 0
1182 1182
            for h in hashes:

Also available in: Unified diff