From 9c63bd688617ee95e420808f1089f5584649bb2a Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Sat, 11 Nov 2017 17:34:27 -0200 Subject: [PATCH] Confere tamanho da btree exportada --- sapl/legacy/scripts/exporta_zope/exporta_zope.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sapl/legacy/scripts/exporta_zope/exporta_zope.py b/sapl/legacy/scripts/exporta_zope/exporta_zope.py index 618c9ec5c..3ebe40b4a 100644 --- a/sapl/legacy/scripts/exporta_zope/exporta_zope.py +++ b/sapl/legacy/scripts/exporta_zope/exporta_zope.py @@ -76,10 +76,13 @@ def enumerate_folder(folder): def enumerate_btree(folder): + contagem_esperada = folder['_count'].value tree = folder['_tree'] - for id, obj in tree.iteritems(): + for contagem_real, (id, obj) in enumerate(tree.iteritems(), start=1): obj, meta_type = br(obj), type(obj).__name__ yield id, obj, meta_type + # verificação de consistência + assert contagem_esperada == contagem_real def dump_folder(folder, path='', enum=enumerate_folder):