code: def test_convert_noop(tmp_path):
      infile = get_test_data(fname="anatomical.nii")
      outfile = tmp_path / "output.nii.gz"
  
      orig = nib.load(infile)
      assert not outfile.exists()
  
      convert.main([str(infile), str(outfile)])
      assert outfile.is_file()
  
      converted = nib.load(outfile)
      assert np.allclose(converted.affine, orig.affine)
      assert converted.shape == orig.shape
      assert converted.get_data_dtype() == orig.get_data_dtype()
  
      infile = get_test_data(fname="resampled_anat_moved.nii")
  
      with pytest.raises(FileExistsError):
          convert.main([str(infile), str(outfile)])
  
      convert.main([str(infile), str(outfile), "--force"])
      assert outfile.is_file()
  
      # Verify that we did overwrite
      converted2 = nib.load(outfile)
      assert not (
          converted2.shape == converted.shape
          and np.allclose(converted2.affine, converted.affine)
          and np.allclose(converted2.get_fdata(), converted.get_fdata())
      )
  
file_path: nibabel/nibabel/cmdline/tests/test_convert.py
imports: import numpy
  import pytest
  import nibabel
  from nibabel.cmdline import convert
  from nibabel.testing import get_test_data
label_desc: Use image node_id 1 for calling a global function with example usage: test_convert_noop(tmp_path) without return types