Beispiel #1
0
    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"))
Beispiel #2
0
 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"})]
Beispiel #3
0
 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