'Assert we get all files processed.
Assert we get all files processed even if there are processing
exceptions.
Test checks case when env content is incorrect.'

def test_continue_on_parse_error(self):

    with mock.patch('glob.glob') as m_ldir:
        m_ldir.return_value = ['/etc_etc/heat/environment.d/a.yaml', '/etc_etc/heat/environment.d/b.yaml']
        env_dir = '/etc_etc/heat/environment.d'
        env_content = '{@$%#$%'
        env = environment.Environment({}, user_env=False)
        with mock.patch('heat.engine.environment.open', mock.mock_open(read_data=env_content), create=True) as m_open:
            environment.read_global_environment(env, env_dir)
    m_ldir.assert_called_once_with((env_dir + '/*'))
    expected = [mock.call(('%s/a.yaml' % env_dir)), mock.call(('%s/b.yaml' % env_dir))]
    self.assertEqual(expected, m_open.call_args_list)
