code: def _do_copyish(self, filename1, filename2):
      # Should be able to rename the file using either name.
      self.assertTrue(os.path.isfile(filename1))  # must exist.
      os.rename(filename1, filename2 + ".new")
      self.assertFalse(os.path.isfile(filename2))
      self.assertTrue(os.path.isfile(filename1 + ".new"))
      os.rename(filename1 + ".new", filename2)
      self.assertFalse(os.path.isfile(filename1 + ".new"))
      self.assertTrue(os.path.isfile(filename2))
  
      shutil.copy(filename1, filename2 + ".new")
      os.unlink(filename1 + ".new")  # remove using equiv name.
      # And a couple of moves, one using each name.
      shutil.move(filename1, filename2 + ".new")
      self.assertFalse(os.path.exists(filename2))
      self.assertTrue(os.path.exists(filename1 + ".new"))
      shutil.move(filename1 + ".new", filename2)
      self.assertFalse(os.path.exists(filename2 + ".new"))
      self.assertTrue(os.path.exists(filename1))
      # Note - due to the implementation of shutil.move,
      # it tries a rename first.  This only fails on Windows when on
      # different file systems - and this test can't ensure that.
      # So we test the shutil.copy2 function, which is the thing most
      # likely to fail.
      shutil.copy2(filename1, filename2 + ".new")
      self.assertTrue(os.path.isfile(filename1 + ".new"))
      os.unlink(filename1 + ".new")
      self.assertFalse(os.path.exists(filename2 + ".new"))
  
file_path: cpython/Lib/test/test_unicode_file.py
imports: import os, glob, time, shutil
  import sys
  import unicodedata
  import unittest
  from test.support.os_helper import rmtree, change_cwd, TESTFN_UNICODE, TESTFN_UNENCODABLE, create_empty_file
label_desc: Use image node_id 2 for calling the TestUnicodeFiles obj's underlying member method code with example usage: obj._do_copyish(filename1, filename2) without return types