pystache.tests.test_specloader module

Unit tests for template_spec.py.

class pystache.tests.test_specloader.AssertPathsMixin[source]

Bases: object

A unittest.TestCase mixin to check path equality.

assertPaths(actual, expected)[source]
class pystache.tests.test_specloader.SpecLoaderTests(methodName='runTest')[source]

Bases: TestCase, AssertIsMixin, AssertStringMixin, AssertPathsMixin

Tests template_spec.SpecLoader.

test_find__template_path()[source]

Test _find() with TemplateSpec.template_path.

test_init__defaults()[source]
test_init__loader()[source]
test_load__template__correct_loader()[source]

Test that reader.unicode() is called correctly.

This test tests that the correct reader is called with the correct arguments. This is a catch-all test to supplement the other test cases. It tests SpecLoader.load() independent of reader.unicode() being implemented correctly (and tested).

test_load__template__type_str()[source]

Test the template attribute: str string.

test_load__template__type_unicode()[source]

Test the template attribute: unicode string.

test_load__template__unicode_non_ascii()[source]

Test the template attribute: non-ascii unicode string.

test_load__template__with_template_encoding()[source]

Test the template attribute: with template encoding attribute.

class pystache.tests.test_specloader.TemplateSpecTests(methodName='runTest')[source]

Bases: TestCase, AssertPathsMixin

test_find__with_directory()[source]

Test _find() with a view that has a directory specified.

test_find__without_directory()[source]

Test _find() with a view that doesn’t have a directory specified.

test_find_relative()[source]

Test _find_relative(): default behavior (no attributes set).

test_find_relative__template_extension()[source]

Test _find_relative(): template_extension attribute.

test_find_relative__template_name()[source]

Test _find_relative(): template_name attribute.

test_find_relative__template_rel_directory()[source]

Test _find_relative(): template_rel_directory attribute.

test_find_relative__template_rel_path__file_name_only()[source]

Test _find_relative(): template_rel_path attribute.

test_find_relative__template_rel_path__file_name_with_directory()[source]

Test _find_relative(): template_rel_path attribute.

test_get_template()[source]

Test get_template(): default behavior (no attributes set).

test_get_template__template_encoding()[source]

Test get_template(): template_encoding attribute.

class pystache.tests.test_specloader.Thing[source]

Bases: object

class pystache.tests.test_specloader.ViewTestCase(methodName='runTest')[source]

Bases: TestCase, AssertStringMixin

test_accessing_properties_on_parent_object_from_child_objects()[source]
test_basic_method_calls()[source]
test_complex()[source]
test_hierarchical_partials_with_lambdas()[source]
test_higher_order_lambda()[source]
test_higher_order_replace()[source]
test_higher_order_rot13()[source]
test_inverted()[source]
test_inverted_lists()[source]
test_non_callable_attributes()[source]
test_partials_with_lambda()[source]
test_template_path_for_partials()[source]

Test that View.template_rel_path is respected for partials.

test_template_rel_directory()[source]

Test that View.template_rel_directory is respected.