Fixing bug in DbMemory.del_list(), where if you passed a filter to delete the whole table it would give index out of bounds. Updated unit test to cover that case.
Change-Id: I1282bd637567ca651ffcd201edfc8ff9fd0950d7
Signed-off-by: Eduardo Sousa <eduardosousa@av.it.pt>
diff --git a/osm_common/dbmemory.py b/osm_common/dbmemory.py
index d7419f4..6f7e4c4 100644
--- a/osm_common/dbmemory.py
+++ b/osm_common/dbmemory.py
@@ -64,7 +64,7 @@
for i, _ in self._find(table, self._format_filter(filter)):
id_list.append(i)
deleted = len(id_list)
- for i in id_list:
+ for i in reversed(id_list):
del self.db[table][i]
return {"deleted": deleted}
except DbException: