Skip to content
Snippets Groups Projects

Resolve "EXTERN: Slicing a Container returns a List, not a Container"

1 file
+ 10
0
Compare changes
  • Side-by-side
  • Inline
@@ -178,3 +178,13 @@ def test_container_deletion_with_references():
assert len(deps14a) == 1 and deps14a.pop() == -1
assert len(deps14b) == 1 and deps14b.pop() == -1
assert len(deps15) == 1 and deps15.pop() == -1
def test_container_slicing():
cont = db.Container()
cont.extend([db.Record(name=f"TestRec{ii+1}") for ii in range(5)])
assert isinstance(cont, db.common.models.Container)
container_slice = cont[:2]
assert isinstance(container_slice, db.common.models.Container), \
f"Container slice should be Container, was {type(container_slice)}"
# cont[:2].retrieve()
Loading