microtemplates
microtemplates copied to clipboard
Multiple Fixes
- Exception Syntax for Python3.6
- items instead of iteritems
- Tests using assertEqual instead of deprecated assertEquals
Unit test run
$ python -m unittest -v
test_keyword_args (microtemplates.tests.CallTests) ... ok
test_no_args (microtemplates.tests.CallTests) ... ok
test_positional_args (microtemplates.tests.CallTests) ... ok
test_each_iterable_as_literal_list (microtemplates.tests.EachTests) ... ok
test_each_iterable_in_context (microtemplates.tests.EachTests) ... ok
test_each_no_tags_inside (microtemplates.tests.EachTests) ... ok
test_each_parent_context (microtemplates.tests.EachTests) ... ok
test_each_space_issues (microtemplates.tests.EachTests) ... ok
test_nested_objects (microtemplates.tests.EachTests) ... ok
test_nested_tag (microtemplates.tests.EachTests) ... ok
test_if_else_else_branch (microtemplates.tests.IfTests) ... ok
test_if_else_if_branch (microtemplates.tests.IfTests) ... ok
test_nested_if (microtemplates.tests.IfTests) ... ok
test_simple_if_is_false (microtemplates.tests.IfTests) ... ok
test_simple_if_is_true (microtemplates.tests.IfTests) ... ok
test_truthy_thingy (microtemplates.tests.IfTests) ... ok
----------------------------------------------------------------------
Ran 16 tests in 0.009s
OK
Fixes various failures in python3.6
1:
except ValueError, IndexError:
^
SyntaxError: invalid syntax
AttributeError: 'dict' object has no attribute 'iteritems'
DeprecationWarning: Please use assertEqual instead.
self.assertEquals(rendered, '32')