# -*- coding: utf-8 -*- """ unit test for streaming interface ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2009 by the Jinja Team. :license: BSD, see LICENSE for more details. """ test_basic_streaming = r""" >>> tmpl = env.from_string("") >>> stream = tmpl.stream(seq=range(4)) >>> stream.next() u'' """ test_buffered_streaming = r""" >>> tmpl = env.from_string("") >>> stream = tmpl.stream(seq=range(4)) >>> stream.enable_buffering(size=3) >>> stream.next() u'' """ test_streaming_behavior = r""" >>> tmpl = env.from_string("") >>> stream = tmpl.stream() >>> stream.buffered False >>> stream.enable_buffering(20) >>> stream.buffered True >>> stream.disable_buffering() >>> stream.buffered False """