Kill the surviving mutants of the e2e command's settings, sandbox and entry point

This commit is contained in:
2026-11-19 03:53:14 +01:00
parent 68d7a31920
commit b709e03023
6 changed files with 115 additions and 30 deletions
+3 -2
View File
@@ -31,13 +31,14 @@ def read(env: typing.Mapping[str, str]) -> Sandbox | Failure:
values = {name: env.get(name, "").strip() for name in MEANING}
url, project = values[JIRA_URL], values[PROJECT]
env_file = pathlib.Path(values[ENV_FILE]) if values[ENV_FILE] else None
absolute = env_file is not None and env_file.is_absolute()
faults = [
*(f"{name} is missing: set it to {meaning}" for name, meaning in MEANING.items() if not values[name]),
*([f"{JIRA_URL} is {url!r}, not an https address without a path"] if url and not re.fullmatch(SITE, url) else []),
*([f"{PROJECT} is {project!r}, not a project key such as SBX"] if project and not re.fullmatch(PROJECT_KEY, project) else []),
*([f"{ENV_FILE} is {values[ENV_FILE]!r}, not an absolute path"] if values[ENV_FILE] and env_file is not None and not env_file.is_absolute() else []),
*([f"{ENV_FILE} is {values[ENV_FILE]!r}, not an absolute path"] if env_file is not None and not absolute else []),
]
if not faults and env_file is not None:
if env_file is not None and absolute:
login = basic_auth(env_file)
if isinstance(login, Failure):
faults.append(login.reason)