File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,6 @@ def create_config_file(self):
103103 logger .debug (f"Ensuring config directory exists: { config_dir } ." )
104104 os .makedirs (config_dir , exist_ok = True )
105105
106- if not os .access (config_dir , os .W_OK ):
107- raise PermissionError (f"Config directory was not writable: { config_dir } " )
108-
109106 config_path = self .config_path
110107 placeholder_config = {
111108 "sources" : [
Original file line number Diff line number Diff line change 11import pytest
22import yaml
3+ import os
34from pydantic import ValidationError
45from pathlib import Path
56from jupyter_fsspec .file_manager import FileSystemManager
@@ -193,13 +194,15 @@ def test_empty_initialize_filesystems(caplog):
193194
194195
195196def test_error_create_config_file (setup_config_dir , config_file ):
197+ os .chmod (config_file , 0o44 )
196198 with patch ("os.access" , return_value = False ):
197199 with pytest .raises (PermissionError ) as exc :
198200 fs_manager = FileSystemManager (config_file )
199201 fs_manager .create_config_file ()
200202
201- expected_exc_msg = f"Config directory was not writable: { setup_config_dir . parent } "
203+ expected_exc_msg = f"[Errno 13] Permission denied: ' { config_file } ' "
202204 assert expected_exc_msg == str (exc .value )
205+ os .chmod (config_file , 0o755 )
203206
204207
205208def test_error_retrieve_config_content (bad_yaml_config ):
You can’t perform that action at this time.
0 commit comments