| /external/python/pyfakefs/pyfakefs/tests/ |
| D | fake_filesystem_unittest_test.py | 2 # Copyright 2015-2017 John McGehee 9 # http://www.apache.org/licenses/LICENSE-2.0 31 from pathlib import Path 100 self.assertFalse(os.path.exists("/fake_file.txt")) 103 self.assertTrue(self.fs.exists("/fake_file.txt")) 113 self.assertFalse(os.path.exists("/fake_file.txt")) 116 self.assertTrue(self.fs.exists("/fake_file.txt")) 126 self.assertFalse(self.fs.exists("/test/dir1/dir2")) 128 self.assertTrue(self.fs.exists("/test/dir1/dir2")) 151 self.assertTrue(self.fs.exists("/test/dir1/dir2b")) [all …]
|
| D | fake_filesystem_shutil_test.py | 7 # http://www.apache.org/licenses/LICENSE-2.0 25 from pathlib import Path 68 dir1_path = self.os.path.join(root_path, "dir1") 69 dir2_path = self.os.path.join(root_path, "dir2") 73 old_file_path = self.os.path.join(dir2_path, "f1.txt") 74 new_file_path = self.os.path.join(dir1_path, "f1.txt") 82 dir_path = os.path.join(directory, "subdir") 84 file_path = os.path.join(directory, "subfile") 86 self.assertTrue(os.path.exists(directory)) 88 self.assertFalse(os.path.exists(directory)) [all …]
|
| D | import_as_example.py | 5 # http://www.apache.org/licenses/LICENSE-2.0 22 from os import path 25 from os.path import exists, isfile, isdir, islink 26 from os.path import exists as my_exists 27 from pathlib import Path 32 return my_os.path.exists(filepath) 36 # tests patching path imported from os 37 return path.exists(filepath) 41 # tests patching Path imported from pathlib 42 return Path(filepath).exists() [all …]
|
| D | fake_os_test.py | 8 # http://www.apache.org/licenses/LICENSE-2.0 43 def createTestFile(self, path): argument 44 self.create_file(path) 45 self.assertTrue(self.os.path.exists(path)) 46 st = self.os.stat(path) 51 def createTestDirectory(self, path): argument 52 self.create_dir(path) 53 self.assertTrue(self.os.path.exists(path)) 54 st = self.os.stat(path) 87 full_dirname = self.os.path.join(dir1, dir2) [all …]
|
| D | fake_filesystem_test.py | 7 # http://www.apache.org/licenses/LICENSE-2.0 70 self.assertEqual(f"{root_dir}somedir/foobar", self.fake_file.path) 71 self.assertEqual(f"{root_dir}somedir", self.fake_dir.path) 78 self.assertEqual(dir_path, dir_object.path) 86 self.assertEqual(f"{root_dir}foo/bar/baz", dir_object.path) 94 self.assertEqual(dir_path, dir_object.path) 109 self.fake_file.size = -1 208 self.fake_file.set_large_file_size(-1) 228 path = "bar" 230 self.assertEqual("/foo/bar", self.filesystem.absnormpath(path)) [all …]
|
| D | fake_pathlib_test.py | 6 # http://www.apache.org/licenses/LICENSE-2.0 56 self.path = pathlib.Path 67 path = self.path("/test") 69 self.assertTrue(isinstance(path, self.pathlib.WindowsPath)) 70 self.assertTrue(isinstance(path, self.pathlib.PureWindowsPath)) 79 self.assertTrue(isinstance(path, self.pathlib.PosixPath)) 80 self.assertTrue(isinstance(path, self.pathlib.PurePosixPath)) 89 """Basic initialization tests - taken from 90 pathlib.Path documentation. 92 self.assertEqual(self.path("/", "foo", "bar", "baz"), self.path("/foo/bar/baz")) [all …]
|
| /external/rust/crates/tempfile/tests/ |
| D | tempdir.rs | 1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT 2 // file at the top-level directory of this distribution and at 3 // http://rust-lang.org/COPYRIGHT. 5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or 6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license 7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your 15 use std::path::Path; 31 fn exists(&self) -> bool; in exists() method 32 fn is_dir(&self) -> bool; in is_dir() 35 impl PathExt for Path { implementation [all …]
|
| D | namedtempfile.rs | 7 use std::path::{Path, PathBuf}; 10 fn exists<P: AsRef<Path>>(path: P) -> bool { in exists() function 11 std::fs::metadata(path.as_ref()).is_ok() in exists() 27 let path = tmpfile.path().to_path_buf(); in test_deleted() localVariable 28 assert!(exists(&path)); in test_deleted() 30 assert!(!exists(&path)); in test_deleted() 36 let old_path = tmpfile.path().to_path_buf(); in test_persist() 40 assert!(exists(&old_path)); in test_persist() 42 assert!(!exists(&old_path)); in test_persist() 52 // Try opening it at the new path. in test_persist() [all …]
|
| /external/rust/crates/predicates/src/path/ |
| D | existence.rs | 1 // Copyright (c) 2018 The predicates-rs Project Developers. 3 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or 4 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license 5 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your 10 use std::path; 18 /// This is created by the `predicate::path::exists` and `predicate::path::missing`. 21 exists: bool, field 24 impl Predicate<path::Path> for ExistencePredicate { 25 fn eval(&self, path: &path::Path) -> bool { in eval() 26 path.exists() == self.exists in eval() [all …]
|
| /external/sdv/vsomeip/third_party/boost/filesystem/test/ |
| D | operations_test.cpp | 1 // Boost operations_test.cpp ---------------------------------------------------------// 69 inline void setenv_(const char* name, const fs::path::value_type* val, int) in setenv_() 102 // file stream I/O, use path::string() to get a narrow character c_str() 121 fs::path dir; 122 fs::path d1; 123 fs::path d2; 124 fs::path f0; 125 fs::path f1; 126 fs::path d1f1; 130 fs::path ng(" no-way, Jose"); [all …]
|
| /external/apache-commons-io/src/test/java/org/apache/commons/io/ |
| D | FileCleaningTrackerTest.java | 9 * http://www.apache.org/licenses/LICENSE-2.0 32 import java.nio.file.Path; 49 private Path testPath; 63 while (file.exists() && count++ < 40) { in pauseForDeleteToComplete() 69 private void pauseForDeleteToComplete(Path file) { in pauseForDeleteToComplete() 71 while (Files.exists(file) && count++ < 40) { in pauseForDeleteToComplete() 79 testFile = new File(tempDirFile, "file-test.txt"); in setUp() 116 if (!testFile.getParentFile().exists()) { in testFileCleanerDirectory_ForceStrategy_FileSource() 124 assertTrue(testFile.exists()); in testFileCleanerDirectory_ForceStrategy_FileSource() 125 assertTrue(tempDirFile.exists()); in testFileCleanerDirectory_ForceStrategy_FileSource() [all …]
|
| /external/python/cpython3/Lib/test/ |
| D | test_py_compile.py | 57 self.source_path = os.path.join(self.directory, '_test.py') 60 self.cwd_drive = os.path.splitdrive(os.getcwd())[0] 62 # current working directory path and the 'self.source_path' might be 65 drive = os.path.splitdrive(self.source_path)[0] 78 self.assertTrue(os.path.exists(self.pyc_path)) 79 self.assertFalse(os.path.exists(self.cache_path)) 89 assert os.path.islink(self.pyc_path) 93 @unittest.skipIf(not os.path.exists(os.devnull) or os.path.isfile(os.devnull), 94 'requires os.devnull and for it to be a non-regular file') 96 # In the face of a cfile argument being a non-regular file, bail out. [all …]
|
| D | test_unicode_file.py | 13 if not os.path.supports_unicode_filenames: 22 if os.path.exists(filename): 27 # file already exists etc. 32 self.assertTrue(os.path.exists(filename)) 33 self.assertTrue(os.path.isfile(filename)) 35 self.assertTrue(os.path.exists(os.path.abspath(filename))) 36 self.assertTrue(os.path.isfile(os.path.abspath(filename))) 37 self.assertTrue(os.access(os.path.abspath(filename), os.R_OK)) 45 os.path.abspath(filename)==os.path.abspath(glob.glob(glob.escape(filename))[0])) 47 path, base = os.path.split(os.path.abspath(filename)) [all …]
|
| /external/mockftpserver/tags/2.x_Before_IDEA/src/test/groovy/org/mockftpserver/fake/filesystem/ |
| D | AbstractFileSystemTest.groovy | 8 * http://www.apache.org/licenses/LICENSE-2.0 35 * @version $Revision: $ - $Date: $ 58 //------------------------------------------------------------------------- 60 //------------------------------------------------------------------------- 63 * Test the exists() method 66 assert !fileSystem.exists(NEW_FILE) 67 assert !fileSystem.exists(NEW_DIR) 68 assert !fileSystem.exists(ILLEGAL_FILE) 69 assert fileSystem.exists(EXISTING_FILE) 70 assert fileSystem.exists(EXISTING_DIR) [all …]
|
| /external/python/setuptools/setuptools/_distutils/tests/ |
| D | test_archive_util.py | 1 # -*- coding: utf-8 -*- 7 from os.path import splitdrive 49 if os.path.supports_unicode_filenames: 107 base_name = os.path.join(tmpdir2, target_name) 115 self.assertTrue(os.path.exists(tarball)) 118 def _tarinfo(self, path): argument 119 tar = tarfile.open(path) 134 dist = os.path.join(tmpdir, 'dist') 138 os.mkdir(os.path.join(dist, 'sub')) 140 os.mkdir(os.path.join(dist, 'sub2')) [all …]
|
| /external/python/cpython3/Lib/distutils/tests/ |
| D | test_archive_util.py | 1 # -*- coding: utf-8 -*- 7 from os.path import splitdrive 53 if os.path.supports_unicode_filenames: 111 base_name = os.path.join(tmpdir2, target_name) 119 self.assertTrue(os.path.exists(tarball)) 122 def _tarinfo(self, path): argument 123 tar = tarfile.open(path) 138 dist = os.path.join(tmpdir, 'dist') 142 os.mkdir(os.path.join(dist, 'sub')) 144 os.mkdir(os.path.join(dist, 'sub2')) [all …]
|
| /external/fonttools/Tests/ufoLib/ |
| D | UFOConversion_test.py | 23 path = self.getFontPath("TestFont1 (UFO1) converted.ufo") 24 if os.path.exists(path): 25 shutil.rmtree(path) 26 path = self.getFontPath("TestFont1 (UFO2) converted.ufo") 27 if os.path.exists(path): 28 shutil.rmtree(path) 31 testdata = os.path.join(os.path.dirname(__file__), "testdata") 32 return os.path.join(testdata, fileName) 36 metainfoPath1 = os.path.join(path1, "metainfo.plist") 37 fontinfoPath1 = os.path.join(path1, "fontinfo.plist") [all …]
|
| /external/cronet/third_party/libc++/src/test/std/input.output/filesystems/fs.op.funcs/fs.op.exists/ |
| D | exists.pass.cpp | 1 //===----------------------------------------------------------------------===// 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 //===----------------------------------------------------------------------===// 10 // UNSUPPORTED: no-filesystem 11 // UNSUPPORTED: availability-filesystem-missing 15 // bool exists(file_status s) noexcept 16 // bool exists(path const& p); 17 // bool exists(path const& p, std::error_code& ec) noexcept; 32 const path p; ((void)p); in signature_test() 34 ASSERT_NOEXCEPT(exists(s)); in signature_test() [all …]
|
| /external/guava/guava-tests/test/com/google/common/io/ |
| D | MoreFilesTest.java | 8 * http://www.apache.org/licenses/LICENSE-2.0 40 import java.nio.file.Path; 65 "MoreFiles.asByteSource[Path]", SourceSinkFactories.pathByteSourceFactory(), true)); in suite() 68 "MoreFiles.asByteSink[Path]", SourceSinkFactories.pathByteSinkFactory())); in suite() 71 "MoreFiles.asByteSink[Path, APPEND]", in suite() 75 "MoreFiles.asCharSource[Path, Charset]", in suite() 80 "MoreFiles.asCharSink[Path, Charset]", SourceSinkFactories.pathCharSinkFactory())); in suite() 83 "MoreFiles.asCharSink[Path, Charset, APPEND]", in suite() 91 private static Path root() { in root() 95 private Path tempDir; [all …]
|
| /external/tensorflow/third_party/gpus/ |
| D | find_rocm_config.py | 7 # http://www.apache.org/licenses/LICENSE-2.0 19 The path to inspect is specified through an environment variable (ROCM_PATH). 24 The script looks for headers and library files in a hard-coded set of 25 subdirectories from base path of the specified directory. If ROCM_PATH is not 45 """Determines and returns the ROCm installation path.""" 49 # rocm_install_path = os.path.realpath(rocm_install_path) 57 def _get_header_version(path, name): argument 59 for line in io.open(path, "r", encoding="utf-8"): 66 " not present in file {} OR\n".format(path) + 72 def rocm_version_numbers_pre_rocm50(path, prior_err): argument [all …]
|
| /external/chromium-trace/catapult/dependency_manager/dependency_manager/ |
| D | dependency_manager_util_unittest.py | 2 # Use of this source code is governed by a BSD-style license that can be 24 self.tmp_dir = os.path.abspath(tempfile.mkdtemp(prefix='telemetry')) 25 self.sub_dir = os.path.join(self.tmp_dir, 'sub_dir') 28 self.read_only_path = (os.path.join(self.tmp_dir, 'read_only')) 30 read_file.write('Read-only file') 33 self.writable_path = (os.path.join(self.tmp_dir, 'writable')) 38 self.executable_path = (os.path.join(self.tmp_dir, 'executable')) 43 self.sub_read_only_path = (os.path.join(self.sub_dir, 'read_only')) 45 read_file.write('Read-only sub file') 48 self.sub_writable_path = (os.path.join(self.sub_dir, 'writable')) [all …]
|
| /external/okio/okio/src/jvmMain/kotlin/okio/ |
| D | JvmSystemFileSystem.kt | 8 * http://www.apache.org/licenses/LICENSE-2.0 20 import okio.Path.Companion.toOkioPath 29 override fun canonicalize(path: Path): Path { in canonicalize() 30 val canonicalFile = path.toFile().canonicalFile in canonicalize() 31 if (!canonicalFile.exists()) throw FileNotFoundException("no such file") in canonicalize() 35 override fun metadataOrNull(path: Path): FileMetadata? { in metadataOrNull() 36 val file = path.toFile() in metadataOrNull() 46 !file.exists() in metadataOrNull() 62 override fun list(dir: Path): List<Path> = list(dir, throwOnFailure = true)!! in list() 64 override fun listOrNull(dir: Path): List<Path>? = list(dir, throwOnFailure = false) in list() [all …]
|
| /external/python/cpython2/Lib/distutils/tests/ |
| D | test_archive_util.py | 1 # -*- coding: utf-8 -*- 9 from os.path import splitdrive 42 if os.path.supports_unicode_filenames: 64 os.mkdir(os.path.join(tmpdir, 'sub')) 71 base_name = os.path.join(tmpdir2, target_name) 83 self.assertTrue(os.path.exists(tarball)) 86 base_name = os.path.join(tmpdir2, target_name) 94 self.assertTrue(os.path.exists(tarball)) 96 def _tarinfo(self, path): argument 97 tar = tarfile.open(path) [all …]
|
| /external/toolchain-utils/crosperf/ |
| D | download_images.py | 1 # -*- coding: utf-8 -*- 2 # Copyright 2014-2015 The ChromiumOS Authors 3 # Use of this source code is governed by a BSD-style license that can be 62 "cd /mnt/host/source/src/third_party/toolchain-utils/crosperf; " 83 # Make sure the directory for downloading the image exists. 85 chromeos_root, os.path.join("/tmp", build_id) 87 image_path = os.path.join(download_path, "chromiumos_test_image.bin") 88 if not os.path.exists(download_path): 93 if not os.path.exists(image_path): 94 gsutil_cmd = os.path.join(chromeos_root, GS_UTIL) [all …]
|
| /external/libcxx/test/std/input.output/filesystems/class.directory_entry/directory_entry.mods/ |
| D | refresh.pass.cpp | 1 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===// 18 // void assign(path const&); 19 // void replace_filename(path const&); 26 #include "rapid-cxx-test.hpp" 43 TEST_CHECK(!e.exists()); in TEST_CASE() 67 const path dir = env.create_dir("dir"); in TEST_CASE() 68 const path file = env.create_file("dir/file", 42); in TEST_CASE() 76 TEST_CHECK(ent.exists()); in TEST_CASE() 81 TEST_CHECK(!ent.exists()); in TEST_CASE() [all …]
|