def test_keep_the_same_operator(self, dict_type): proxy = Cut(dict_type({"users": [{ "name": "a" }, { "name": "b" }]}), sep="/") separators = [] assert all(item.sep == "/" for item in proxy.all("users"))
def test_all(self, dict_type): proxy = Cut(dict_type({"users": [{"name": "a"}, {"name": "b"}]})) values = [item for item in proxy.all("users")] assert values == [Cut({"name": "a"}), Cut({"name": "b"})]
def test_return_generator(self, dict_type): proxy = Cut(dict_type({"users": [{"name": "a"}, {"name": "b"}]})) result = proxy.all("users") assert isinstance(result, GeneratorType) is True