Fixing a multitude of tests

This commit is contained in:
Qubasa
2023-10-23 22:31:12 +02:00
parent d1c35301e3
commit 3581e0c9a8
25 changed files with 154 additions and 113 deletions

View File

@@ -3,7 +3,7 @@ import logging
from typing import Annotated
from fastapi import APIRouter, Body
from clan_cli.debug import repro_env_break
from ...config.machine import (
config_for_machine,
schema_for_machine,
@@ -33,6 +33,7 @@ async def list_machines(flake_name: FlakeName) -> MachinesResponse:
machines = []
for m in _list_machines(flake_name):
machines.append(Machine(name=m, status=Status.UNKNOWN))
return MachinesResponse(machines=machines)

View File

@@ -12,7 +12,7 @@ from typing import Iterator
# XXX: can we dynamically load this using nix develop?
import uvicorn
from pydantic import AnyUrl, IPvAnyAddress
from pydantic.tools import parse_obj_as
from clan_cli.errors import ClanError
log = logging.getLogger(__name__)
@@ -25,7 +25,8 @@ def open_browser(base_url: AnyUrl, sub_url: str) -> None:
break
except OSError:
time.sleep(i)
url = AnyUrl(f"{base_url}/{sub_url.removeprefix('/')}")
url = parse_obj_as(
AnyUrl,f"{base_url}/{sub_url.removeprefix('/')}")
_open_browser(url)