diff -r 654d473f2951 Lib/test/test_ntpath.py --- a/Lib/test/test_ntpath.py Wed May 11 22:20:11 2011 -0700 +++ b/Lib/test/test_ntpath.py Thu May 12 10:59:26 2011 -0700 @@ -240,6 +240,23 @@ tester('ntpath.relpath("/a/b", "/a/b")', '.') tester('ntpath.relpath("c:/foo", "C:/FOO")', '.') + @staticmethod + def _create_file(filename): + with open(filename, 'wb') as f: + f.write(b'foo') + return f.name + + def test_samefile(self): + test_fn = support.TESTFN + '1' + fname = self._create_file(test_fn) + self.assertTrue(ntpath.samefile(test_fn, test_fn)) + self.assertTrue(ntpath.samefile(test_fn, fname)) + self.assertTrue(ntpath.samefile(ntpath.abspath(test_fn), fname)) + self.assertTrue(ntpath.samefile(test_fn.lower(), fname.upper())) + self.assertTrue(ntpath.samefile(test_fn.lower(), + ntpath.abspath(fname.upper()))) + self.assertRaises(TypeError, ntpath.samefile) + def test_sameopenfile(self): with TemporaryFile() as tf1, TemporaryFile() as tf2: # Make sure the same file is really the same