Added test for MapBlock

pull/84/head
Andrey Tikhonov 2018-04-17 13:28:57 +03:00 committed by Andrew Krasichkov
parent 6f0edbc980
commit 82508941bd
1 changed files with 16 additions and 0 deletions

View File

@ -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')