pystache.tests.test_renderer module
Unit tests of template.py.
- class pystache.tests.test_renderer.RendererInitTestCase(methodName='runTest')[source]
Bases:
TestCase
Tests the Renderer.__init__() method.
- test_search_dirs__list()[source]
Check that the search_dirs attribute is set correctly when a list.
- class pystache.tests.test_renderer.RendererTests(methodName='runTest')[source]
Bases:
TestCase
,AssertStringMixin
Test the Renderer class.
- test_custom_string_coercion_via_assignment()[source]
Test that string coercion can be customized via attribute assignment.
- test_custom_string_coercion_via_subclassing()[source]
Test that string coercion can be customized via subclassing.
- test_make_resolve_partial__unicode()[source]
Test _make_resolve_partial(): that resolve_partial doesn’t “double-decode” Unicode.
- test_render__context_and_kwargs__precedence()[source]
Test render(): kwargs takes precedence over context.
- test_render__kwargs_does_not_modify_context()[source]
Test render(): passing kwargs does not modify the passed context.
- class pystache.tests.test_renderer.Renderer_MakeRenderEngineTests(methodName='runTest')[source]
Bases:
TestCase
,AssertStringMixin
,AssertExceptionMixin
Check the RenderEngine returned by Renderer._make_render_engine().
- test__escape__has_access_to_original_unicode_subclass()[source]
Test that escape receives strings with the unicode subclass intact.
- test__escape__uses_renderer_unicode()[source]
Test that escape uses the renderer’s unicode function.
- test__literal__uses_renderer_unicode()[source]
Test that literal uses the renderer’s unicode function.
- test__missing_tags__unknown_value()[source]
Check missing_tags attribute: setting an unknown value.
- test__resolve_context__missing_tags_strict()[source]
Check resolve_context(): missing_tags ‘strict’.
- test__resolve_partial__not_found()[source]
Check that resolve_partial returns the empty string when a template is not found.
- test__resolve_partial__not_found__missing_tags_strict()[source]
Check that resolve_partial provides a nice message when a template is not found.
- test__resolve_partial__not_found__partials_dict()[source]
Check that resolve_partial returns the empty string when a template is not found.