Added inspect() command
This commit is contained in:
@@ -211,3 +211,19 @@ class TestSheerkaFilter(TestUsingMemoryBasedSheerka):
|
||||
assert isinstance(format_instructions, FormatInstructions)
|
||||
assert format_instructions.recursive_props["children"] == 10
|
||||
assert format_instructions.recursive_props["other_prop"] == 15
|
||||
|
||||
def test_i_can_inspect_obj(self):
|
||||
filter_service = SheerkaFilter(None)
|
||||
|
||||
lst = [Obj("a", "b"), Obj("c", "d")]
|
||||
res = lst | Pipe(filter_service.pipe_inspect)("prop2")
|
||||
|
||||
assert list(res) == ["b", "d"]
|
||||
|
||||
def test_i_can_inspect_obj_with_bag(self):
|
||||
filter_service = SheerkaFilter(None)
|
||||
|
||||
lst = [ObjWithAsBag("a", "b"), ObjWithAsBag("c", "d")]
|
||||
res = lst | Pipe(filter_service.pipe_inspect)("second_prop")
|
||||
|
||||
assert list(res) == ["b", "d"]
|
||||
|
||||
Reference in New Issue
Block a user