@@ -186,63 +186,6 @@ def test_islink(self):
186186 if not f .close ():
187187 f .close ()
188188
189- @staticmethod
190- def _create_file (filename ):
191- with open (filename , 'wb' ) as f :
192- f .write (b'foo' )
193-
194- def test_samefile (self ):
195- test_fn = support .TESTFN + "1"
196- self ._create_file (test_fn )
197- self .assertTrue (posixpath .samefile (test_fn , test_fn ))
198- self .assertRaises (TypeError , posixpath .samefile )
199-
200- @unittest .skipIf (
201- sys .platform .startswith ('win' ),
202- "posixpath.samefile does not work on links in Windows" )
203- @unittest .skipUnless (hasattr (os , "symlink" ),
204- "Missing symlink implementation" )
205- def test_samefile_on_links (self ):
206- test_fn1 = support .TESTFN + "1"
207- test_fn2 = support .TESTFN + "2"
208- self ._create_file (test_fn1 )
209-
210- os .symlink (test_fn1 , test_fn2 )
211- self .assertTrue (posixpath .samefile (test_fn1 , test_fn2 ))
212- os .remove (test_fn2 )
213-
214- self ._create_file (test_fn2 )
215- self .assertFalse (posixpath .samefile (test_fn1 , test_fn2 ))
216-
217-
218- def test_samestat (self ):
219- test_fn = support .TESTFN + "1"
220- self ._create_file (test_fn )
221- test_fns = [test_fn ]* 2
222- stats = map (os .stat , test_fns )
223- self .assertTrue (posixpath .samestat (* stats ))
224-
225- @unittest .skipIf (
226- sys .platform .startswith ('win' ),
227- "posixpath.samestat does not work on links in Windows" )
228- @unittest .skipUnless (hasattr (os , "symlink" ),
229- "Missing symlink implementation" )
230- def test_samestat_on_links (self ):
231- test_fn1 = support .TESTFN + "1"
232- test_fn2 = support .TESTFN + "2"
233- self ._create_file (test_fn1 )
234- test_fns = (test_fn1 , test_fn2 )
235- os .symlink (* test_fns )
236- stats = map (os .stat , test_fns )
237- self .assertTrue (posixpath .samestat (* stats ))
238- os .remove (test_fn2 )
239-
240- self ._create_file (test_fn2 )
241- stats = map (os .stat , test_fns )
242- self .assertFalse (posixpath .samestat (* stats ))
243-
244- self .assertRaises (TypeError , posixpath .samestat )
245-
246189 def test_ismount (self ):
247190 self .assertIs (posixpath .ismount ("/" ), True )
248191 with warnings .catch_warnings ():
@@ -518,11 +461,6 @@ def test_relpath_bytes(self):
518461 finally :
519462 os .getcwdb = real_getcwdb
520463
521- def test_sameopenfile (self ):
522- fname = support .TESTFN + "1"
523- with open (fname , "wb" ) as a , open (fname , "wb" ) as b :
524- self .assertTrue (posixpath .sameopenfile (a .fileno (), b .fileno ()))
525-
526464
527465class PosixCommonTest (test_genericpath .CommonTest ):
528466 pathmodule = posixpath
0 commit comments