<s> import pytest <EOL> from pathlib import Path <EOL> from unittest import mock <EOL> from growler . middleware . renderer import StringRenderer <EOL> from growler . http . response import HTTPResponse <EOL> @ pytest . fixture <EOL> def res ( ) : <EOL> return mock . create_autospec ( HTTPResponse ) <EOL> @ pytest . fixture <EOL> def ren ( res ) : <EOL> return StringRenderer ( ) <EOL> @ pytest . fixture <EOL> def viewdir ( tmpdir ) : <EOL> return Path ( str ( tmpdir ) ) <EOL> @ pytest . fixture <EOL> def sr ( viewdir ) : <EOL> return StringRenderer ( viewdir ) <EOL> def test_string_renderer_fixture ( sr ) : <EOL> assert isinstance ( sr , StringRenderer ) <EOL> def test_render_file ( sr , viewdir ) : <EOL> txt = """<STR_LIT>""" <EOL> view = viewdir . joinpath ( "<STR_LIT>" ) <EOL> view . touch ( ) <EOL> view . write_text ( txt ) <EOL> res = sr . render_source ( "<STR_LIT>" ) <EOL> assert res == txt </s>
