Skip to content
Snippets Groups Projects
Commit 8ca6abe5 authored by Joscha Schmiedt's avatar Joscha Schmiedt
Browse files

Add failing test for continer slicing

parent 65f3f927
Branches
Tags
2 merge requests!143Release 0.15.0,!131Resolve "EXTERN: Slicing a Container returns a List, not a Container"
Pipeline #47850 failed
...@@ -178,3 +178,13 @@ def test_container_deletion_with_references(): ...@@ -178,3 +178,13 @@ def test_container_deletion_with_references():
assert len(deps14a) == 1 and deps14a.pop() == -1 assert len(deps14a) == 1 and deps14a.pop() == -1
assert len(deps14b) == 1 and deps14b.pop() == -1 assert len(deps14b) == 1 and deps14b.pop() == -1
assert len(deps15) == 1 and deps15.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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment