示例#1
0
    def test_adjacent_directory_exists(self, name, tmpdir):
        block_name, expect_name = itertools.islice(
            AdjacentTempDirectory._generate_names(name), 2)

        original = os.path.join(tmpdir, name)
        blocker = os.path.join(tmpdir, block_name)

        ensure_dir(original)
        ensure_dir(blocker)

        with AdjacentTempDirectory(original) as atmp_dir:
            assert expect_name == os.path.split(atmp_dir.path)[1]
示例#2
0
文件: test_utils.py 项目: pypa/pip
    def test_adjacent_directory_exists(self, name, tmpdir):
        block_name, expect_name = itertools.islice(
            AdjacentTempDirectory._generate_names(name), 2)

        original = os.path.join(tmpdir, name)
        blocker = os.path.join(tmpdir, block_name)

        ensure_dir(original)
        ensure_dir(blocker)

        with AdjacentTempDirectory(original) as atmp_dir:
            assert expect_name == os.path.split(atmp_dir.path)[1]
示例#3
0
 def names():
     return AdjacentTempDirectory._generate_names(name)
示例#4
0
 def names() -> Iterator[str]:
     return AdjacentTempDirectory._generate_names(name)
示例#5
0
 def names():
     return AdjacentTempDirectory._generate_names(name)