def test_get(self): assert isinstance(NullCollection()[0], NullNode)
def test_first(self): assert isinstance(NullCollection().first(), NullNode)
def test_slice(self): assert isinstance(NullCollection()[::2], NullCollection)
def test_collection_to_collection_methods(self, func): result = getattr(NullCollection(), func)(lambda x: 1) assert isinstance(result, NullCollection)
def test_dump(self): with pytest.raises(NullValueError): return NullCollection().dump().val()
def test_iter_val(self): with pytest.raises(NullValueError): return NullCollection().iter_val()
def test_count(self): assert Collection([]).count().val() == 0 assert Collection([Scalar(1)]).count().val() == 1 assert NullCollection().count().val() == 0