'Test include dir recursive list yaml.'

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

    mock_walk.return_value = [['/tmp', ['tmp2', '.ignore', 'ignore'], ['zero.yaml']], ['/tmp/tmp2', [], ['one.yaml', 'two.yaml']], ['/tmp/ignore', [], ['.ignore.yaml']]]
    with patch_yaml_files({'/tmp/zero.yaml': 'zero', '/tmp/tmp2/one.yaml': 'one', '/tmp/tmp2/two.yaml': 'two'}):
        conf = 'key:    !include_dir_list    /tmp'
        with io.StringIO(conf) as file:
            assert ('.ignore' in mock_walk.return_value[0][1]), 'Expecting    .ignore    in    here'
            doc = yaml.yaml.safe_load(file)
            assert ('tmp2' in mock_walk.return_value[0][1])
            assert ('.ignore' not in mock_walk.return_value[0][1])
            assert (sorted(doc['key']) == sorted(['zero', 'one', 'two']))
