'Test include dir merge named yaml.'

@patch('homeassistant.util.yaml.os.walk')
def test_include_dir_merge_named(self, mock_walk):

    mock_walk.return_value = [['/tmp', [], ['first.yaml', 'second.yaml']]]
    files = {'/tmp/first.yaml': 'key1:    one', '/tmp/second.yaml': 'key2:    two\nkey3:    three'}
    with patch_yaml_files(files):
        conf = 'key:    !include_dir_merge_named    /tmp'
        with io.StringIO(conf) as file:
            doc = yaml.yaml.safe_load(file)
            assert (doc['key'] == {'key1': 'one', 'key2': 'two', 'key3': 'three'})
