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_extended('name')
    m_open.return_value.write.assert_called_once_with(
        'n\ne\n1\n\n\nw\nq\n'
    )
    mock_command.assert_called_once_with(
        ['bash', '-c', 'cat tempfile | fdisk /dev/loop0']
    )