import pytest,os from services.auth_service import AuthService class TestAuthService: def test_hash_consistent(self): s=AuthService({});assert s._hash_password("x")==s._hash_password("x") def test_hash_len(self): assert len(AuthService({})._hash_password("x"))==64 def test_invalid_login(self): assert AuthService({}).authenticate_user("admin","WRONG") is None def test_valid_login(self): pw=os.environ.get("SENSU_ADMIN_PASSWORD","admin123") assert AuthService({}).authenticate_user("admin",pw) is not None