MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_samefile

Method test_samefile

Lib/test/test_pathlib/test_pathlib.py:2822–2841  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2820 self.assertFalse((R / '\udfff').is_mount())
2821
2822 def test_samefile(self):
2823 parser = self.parser
2824 fileA_path = parser.join(self.base, 'fileA')
2825 fileB_path = parser.join(self.base, 'dirB', 'fileB')
2826 p = self.cls(fileA_path)
2827 pp = self.cls(fileA_path)
2828 q = self.cls(fileB_path)
2829 self.assertTrue(p.samefile(fileA_path))
2830 self.assertTrue(p.samefile(pp))
2831 self.assertFalse(p.samefile(fileB_path))
2832 self.assertFalse(p.samefile(q))
2833 # Test the non-existent file case
2834 non_existent = parser.join(self.base, 'foo')
2835 r = self.cls(non_existent)
2836 self.assertRaises(FileNotFoundError, p.samefile, r)
2837 self.assertRaises(FileNotFoundError, p.samefile, non_existent)
2838 self.assertRaises(FileNotFoundError, r.samefile, p)
2839 self.assertRaises(FileNotFoundError, r.samefile, non_existent)
2840 self.assertRaises(FileNotFoundError, r.samefile, r)
2841 self.assertRaises(FileNotFoundError, r.samefile, non_existent)
2842
2843 def test_passing_kwargs_errors(self):
2844 with self.assertRaises(TypeError):

Callers

nothing calls this directly

Calls 6

assertTrueMethod · 0.80
samefileMethod · 0.80
assertFalseMethod · 0.80
joinMethod · 0.45
clsMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected