def test_iteritems(self): idx = NSIndex() for x in range(100): idx[bytes('%-0.32d' % x, 'ascii')] = x, x all = list(idx.iteritems()) self.assert_equal(len(all), 100) second_half = list(idx.iteritems(marker=all[49][0])) self.assert_equal(len(second_half), 50) self.assert_equal(second_half, all[50:])
def extract_and_unlink_index(): index_name = [n for n in os.listdir(os.path.join(self.tmppath, "repository")) if n.startswith("index")][0] idx = NSIndex(os.path.join(self.tmppath, "repository", index_name)) os.unlink(os.path.join(self.tmppath, "repository", index_name)) return list(idx.iteritems())
def extract_and_unlink_index(): index_name = [n for n in os.listdir(os.path.join(self.tmppath, 'repository')) if n.startswith('index')][0] idx = NSIndex(os.path.join(self.tmppath, 'repository', index_name)) os.unlink(os.path.join(self.tmppath, 'repository', index_name)) return list(idx.iteritems())