From 82508941bd9d51e90bd25877b43e31036e52e30b Mon Sep 17 00:00:00 2001 From: Andrey Tikhonov Date: Tue, 17 Apr 2018 13:28:57 +0300 Subject: [PATCH] Added test for MapBlock --- tests/directives/test_block.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/directives/test_block.py b/tests/directives/test_block.py index 866b6eb..2c2d491 100644 --- a/tests/directives/test_block.py +++ b/tests/directives/test_block.py @@ -203,3 +203,19 @@ def test_block_find_not_flat(): assert_equals(len(finds), 1) assert_equals([x.name for x in finds], ['directive']) assert_equals([x.args[0] for x in finds], ['1']) + + +def test_block_map(): + config = ''' +map $some_var $some_other_var { + a b; + default c; +} + ''' + + directive = _get_parsed(config) + assert_is_instance(directive, MapBlock) + assert_true(directive.is_block) + assert_false(directive.self_context) + assert_true(directive.provide_variables) + assert_equals(directive.variable, 'some_other_var')