'Test include dir named yaml.'

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

    mock_walk.return_value = [['/tmp', [], ['first.yaml', 'second.yaml']]]
    with patch_yaml_files({'/tmp/first.yaml': 'one', '/tmp/second.yaml': 'two'}):
        conf = 'key:    !include_dir_named    /tmp'
        correct = {'first': 'one', 'second': 'two'}
        with io.StringIO(conf) as file:
            doc = yaml.yaml.safe_load(file)
            assert (doc['key'] == correct)
