Skip to content

Commit 71c883a

Browse files
author
Jonathan Visser
committed
Change unit test to test the check_can_write_to_main_config_dir function
1 parent ba4fcde commit 71c883a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tests/test_nginx_config_reloader.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -654,13 +654,8 @@ def test_no_permission_to_main_config_dir(self):
654654

655655
tm = self._get_nginx_config_reloader_instance()
656656
try:
657-
with self.assertLogs('root', level='ERROR') as cm:
658-
result = tm.apply_new_config()
659-
self.assertFalse(result)
660-
self.assertTrue(
661-
any("No write permissions to main nginx config directory" in message for message in cm.output),
662-
"Expected error message not found in logs."
663-
)
657+
result = tm.check_can_write_to_main_config_dir()
658+
self.assertFalse(result)
664659
finally:
665660
# Restore permissions after test
666661
os.chmod(self.main, 0o700)

0 commit comments

Comments
 (0)