fix: add null safety check to URL construction in test_login.py
- Add explicit check for ERP_URL environment variable - Prevent AttributeError when ERP_URL is not set - Provide clear error message for missing configuration Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,10 @@ print(f" Headless: {os.getenv('ERP_HEADLESS')}")
|
||||
print(f" Ignore HTTPS Errors: {os.getenv('ERP_IGNORE_HTTPS_ERRORS')}")
|
||||
|
||||
# Construct complete login URL
|
||||
url = f"{os.getenv('ERP_URL').rstrip('/')}/yonbip/resources/uap/rbac/login/main/index.html"
|
||||
base_url = os.getenv('ERP_URL')
|
||||
if not base_url:
|
||||
raise ValueError("ERP_URL environment variable is required")
|
||||
url = f"{base_url.rstrip('/')}/yonbip/resources/uap/rbac/login/main/index.html"
|
||||
|
||||
try:
|
||||
with sync_playwright() as p:
|
||||
|
||||
Reference in New Issue
Block a user