def test_path_type_unknown(tmp_path): p = type( 'FakePath', (), { 'exists': lambda: True, 'is_dir': lambda: False, 'is_file': lambda: False, 'is_mount': lambda: False, 'is_symlink': lambda: False, 'is_block_device': lambda: False, 'is_char_device': lambda: False, 'is_fifo': lambda: False, 'is_socket': lambda: False, }, ) assert path_type(p) == 'unknown'
def test_path_type(tmp_path): assert path_type(tmp_path) == 'directory' file = tmp_path / 'foobar.txt' file.write_text('hello') assert path_type(file) == 'file'