( filesystem )
凡例
| → | 対応コードあり |
| → | 直接対応していないが代替の書き方あり |
| → | 対応コードなし |
| - | 未確認 |
| ( .. ) | ローカライズまだ |
| Example | Python pytest |
PHP PHPUnit |
Swift Testing |
Csharp xunit |
Bash bats |
Powershell pester |
C++ GoogleTest |
JavaScript Jest |
Kotlin jUnit |
|---|---|---|---|---|---|---|---|---|---|
| ( file_exists ) | → | is_file | - | - | - | - | - | - | - |
| ( directory_exists ) | os.path.isdir | is_dir | - | - | - | - | - | - | - |
| ( path_exists ) | os.path.exists | file_exists | - | - | - | - | - | - | - |
| ( temp_file ) | tempfile.NamedTemporaryFile | tempnam($dir, $prefix) | - | - | - | - | - | - | - |
| ( temp_directory ) | tempfile.TemporaryDirectory | sys_get_temp_dir() | - | - | - | - | - | - | - |
| ( get_file_size ) | os.path.getsize(fname) | filesize($filename) | - | - | - | - | - | - | - |
| ( make_directory ) | os.mkdir() | mkdir($path) | - | - | - | - | - | - | - |
| ( make_directory_with_parents ) | os.makedirs(path, exist_ok=True) | mkdir($path, recursive: true) | - | - | - | - | - | - | - |
| ( remove_directory ) | os.rmdir() | rmdir($path) | - | - | - | - | - | - | - |
| ( remove_directory_recursive_if_parent_becomes_empty ) | os.removedirs() | → | - | - | - | - | - | - | - |
| ( remove_directory_recursive_with_contents ) | shutil.rmtree | → | - | - | - | - | - | - | - |
| ( copy_directory_tree ) | shutil.copytree(dir1, dir2) | → | - | - | - | - | - | - | - |
| ( change_current_directory ) | os.chdir | chdir($path) | - | - | - | - | - | - | - |
| ( get_current_directory ) | os.getcwd | getcwd() | - | - | - | - | - | - | - |
| ( push_directory ) | contextlib.chdir | - | - | - | - | - | - | - | - |
| ( touch_file ) | p.touch() | touch($filename) | - | - | - | - | - | - | - |
| ( remove_file ) | os.remove(fname) | unlink($filename) | - | - | - | - | - | - | - |
| ( copy_file ) | shutil.copyfile(b, a) | copy($src, $dst) | - | - | - | - | - | - | - |
| ( move_file ) | os.rename(b, a) | rename($src, $dst) | - | - | - | - | - | - | - |
| ( move_file_to_directory ) | shutil.move(b, a) | rename($src, $dst) | - | - | - | - | - | - | - |
| ( umask ) | os.umask(mask) | - | - | - | - | - | - | - | - |