def test_path_like_objects(self): # An implicit test for PyUnicode_FSDecoder(). compile("42", FakePath("test_compile_pathlike"), "single")
def test_path_join(self): self.assertEqual(self.path.join('a', FakePath('b'), 'c'), self.path.join('a', 'b', 'c'))
def setUp(self): self.file_name = os_helper.TESTFN.lower() self.file_path = FakePath(os_helper.TESTFN) self.addCleanup(os_helper.unlink, self.file_name) create_file(self.file_name, b"test_genericpath.PathLikeTests")
def setUp(self): self.file_name = os_helper.TESTFN self.file_path = FakePath(os_helper.TESTFN) self.addCleanup(os_helper.unlink, self.file_name) with open(self.file_name, 'xb', 0) as file: file.write(b"test_ntpath.PathLikeTests")
def test_open_with_pathlib_bytes_path(self): gdbm.open(FakePath(os.fsencode(filename)), "c").close()
def test_open_with_pathlib_path(self): gdbm.open(FakePath(filename), "c").close()
def test_path_objects(self): # If the source is a Path object, use it as a system ID and open it. prep = prepare_input_source(FakePath(self.file)) self.assertIsNone(prep.getCharacterStream()) self.checkContent(prep.getByteStream(), b"This was read from a file.")
def test_parse_path_object(self): make_xml_file(self.data, 'utf-8', None) self.check_parse(FakePath(TESTFN))