(dotenv_file)
| 63 | |
| 64 | |
| 65 | def 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 | |
| 76 | def test_get_key_no_file(tmp_path): |