def METHOD_NAME(
    self, mock_temp, mock_flag, mock_command
):
    mock_command.side_effect = Exception
    temp_type = namedtuple(
        'temp_type', ['name']
    )
    mock_temp.return_value = temp_type(
        name='tempfile'
    )
    m_open = mock_open()
    with patch('builtins.open', m_open, create=True):
        self.partitioner.create('name', 'all_free', 't.linux')
    m_open.return_value.write.assert_called_once_with(
        'n\np\n1\n\n\nw\nq\n'
    )