MCPcopy Create free account
hub / github.com/theskumar/python-dotenv / test_set_key_permission_error

Function test_set_key_permission_error

tests/test_main.py:65–73  ·  view source on GitHub ↗
(dotenv_file)

Source from the content-addressed store, hash-verified

63
64
65def test_set_key_permission_error(dotenv_file):
66 os.chmod(dotenv_file, 0o000)
67
68 with pytest.raises(Exception):
69 dotenv.set_key(dotenv_file, "a", "b")
70
71 os.chmod(dotenv_file, 0o600)
72 with open(dotenv_file, "r") as fp:
73 assert fp.read() == ""
74
75
76def test_get_key_no_file(tmp_path):

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected