Skip to content
Snippets Groups Projects
Commit 1f2c0023 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

TST: add test for filter function of Container

parent df8f9231
No related branches found
No related tags found
2 merge requests!175BUG: Request responses without the "Set-Cookie" header no longer overwrite the...,!172ENH: add new member function filter to Container class
Pipeline #59489 failed
...@@ -199,3 +199,12 @@ def test_container_slicing(): ...@@ -199,3 +199,12 @@ def test_container_slicing():
with pytest.raises(TypeError): with pytest.raises(TypeError):
cont[[0, 2, 3]] cont[[0, 2, 3]]
def test_container_filter():
# this is a very rudimentary test since filter is based on _filter_entity_list which is tested
# separately
cont = db.Container()
cont.extend([db.Record(name=f"TestRec{ii+1}") for ii in range(5)])
recs = cont.filter(name="TestRec2")
assert len(recs)==1
recs[0].name =="TestRec2"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment