def METHOD_NAME(self, mock_BlockID, mock_temp, mock_Command_run):
    temp_type = namedtuple(
        'temp_type', ['name']
    )
    mock_temp.return_value = temp_type(
        name='tempfile'
    )
    m_open = mock_open()
    mock_BlockID.return_value.get_partition_count.return_value = 4
    with patch('builtins.open', m_open, create=True):
        self.partitioner.set_start_sector(4096)
    assert m_open.return_value.write.call_args_list == [
        call('d\n1\nn\np\n4096\n\nw\nq\n')
    ]
    mock_Command_run.assert_called_once_with(
        ['bash', '-c', 'cat tempfile | fdisk /dev/loop0']
    )
    mock_BlockID.return_value.get_partition_count.return_value = 3
    m_open.reset_mock()
    with patch('builtins.open', m_open, create=True):
        self.partitioner.set_start_sector(4096)
    assert m_open.return_value.write.call_args_list == [
        call('d\n1\nn\np\n1\n4096\n\nw\nq\n')
    ]