def METHOD_NAME(
    self, mock_exists, mock_command
):
    mock_open.return_value = self.context_manager_mock
    mock_exists.return_value = True
    m_open = mock_open()
    with patch('builtins.open', m_open, create=True):
        self.disk_format.create_image_format()
    m_open.assert_called_once_with(
        'target_dir/some-disk-image.x86_64-1.2.3.vmx', 'w'
    )