Merge dev to main: Security improvements and comprehensive test infrastructure #39
@@ -278,6 +278,14 @@ class TestPasswordPersistence:
|
|||||||
|
|
||||||
def test_load_password_hash_from_env(self, mock_config, temp_auth_file):
|
def test_load_password_hash_from_env(self, mock_config, temp_auth_file):
|
||||||
"""Test loading password hash from environment variable."""
|
"""Test loading password hash from environment variable."""
|
||||||
|
# Clear any hash in the file first
|
||||||
|
import json
|
||||||
|
with open(temp_auth_file, 'r') as f:
|
||||||
|
data = json.load(f)
|
||||||
|
data['password_hash'] = ""
|
||||||
|
with open(temp_auth_file, 'w') as f:
|
||||||
|
json.dump(data, f)
|
||||||
|
|
||||||
# When no hash in file, should return env var
|
# When no hash in file, should return env var
|
||||||
loaded = load_password_hash()
|
loaded = load_password_hash()
|
||||||
assert loaded == mock_config.ADMIN_PASSWORD_HASH
|
assert loaded == mock_config.ADMIN_PASSWORD_HASH
|
||||||
|
|||||||
Reference in New Issue
Block a user