Taragolis commented on code in PR #38164:
URL: https://github.com/apache/airflow/pull/38164#discussion_r1525551503
##########
tests/utils/test_log_handlers.py:
##########
@@ -754,3 +754,15 @@ def test_permissions_for_new_directories():
os.umask(old_umask)
finally:
shutil.rmtree(tmp_path)
+
+
+def test_permissions_for_home_directory_subdir():
+ home_dir = Path.home()
+ for dir in home_dir.glob("*"):
+ if dir.is_dir():
+ with patch("pathlib.Path.chmod") as mock_chmod:
+ _change_directory_permissions_up(dir, 0o000)
+ # Should only be called once - for the subdir - but not for
the home directory
+ mock_chmod.assert_called_once_with(0o000)
+ return
+ pytest.fail("No directory found in home directory")
Review Comment:
Something similar we have into impersonation tests:
https://github.com/apache/airflow/blob/be2c93a92b2ce5f05cc94715f8621385cd17e284/tests/core/test_impersonation_tests.py#L92-L101
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]