Skip to content
Myr

Improved tests for sum

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 8e08a21 · Browse files · 1 file+12 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−10 removed

  • tests:+12 added−10 removed

1 file+12 added−10 removed

modified:tests/test_asyncfilters.py+12 added-10 removed
182 unmodified lines
183 tmpl = env_async.from_string('{{ none|map("upper")|list }}')184 assert tmpl.render() == '[]'185186187@mark_dualiter('items', lambda: [1, 2, 3, 4, 5, 6])187def test_sum(env_async):188 tmpl = env_async.from_string('''{{ [1, 2, 3, 4, 5, 6]|sum }}''')189 assert tmpl.render() == '21'188def test_sum(env_async, items):189 tmpl = env_async.from_string('''{{ items()|sum }}''')190 assert tmpl.render(items=items) == '21'191192192def test_sum_attributes(env_async):193 tmpl = env_async.from_string('''{{ values|sum('value') }}''')194 assert tmpl.render(values=[195 {'value': 23},196 {'value': 1},197 {'value': 18},198 ]) == '42'193@mark_dualiter('items', lambda: [194 {'value': 23},195 {'value': 1},196 {'value': 18},197])198def test_sum_attributes(env_async, items):199 tmpl = env_async.from_string('''{{ items()|sum('value') }}''')200 assert tmpl.render(items=items)201202203def test_sum_attributes_nested(env_async):204 tmpl = env_async.from_string('''{{ values|sum('real.value') }}''')
14 unmodified lines