'Test raising a UnicodeDecodeError.'

@patch('homeassistant.util.yaml.open', create=True)
def test_load_yaml_encoding_error(self, mock_open):

    mock_open.side_effect = UnicodeDecodeError('', '', 1, 0, '')
    self.assertRaises(HomeAssistantError, yaml.load_yaml, 'test')
