Keep B2 client fixes and move VPS implementation to its standalone repository
This commit is contained in:
@@ -63,18 +63,11 @@ def test_initial_usb_apply_rejects_unowned_or_incompatible_destination(case):
|
||||
|
||||
|
||||
def test_initial_usb_apply_accepts_current_shipped_host():
|
||||
import ast
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
# Read the shipped artifact's version without importing its hardware service.
|
||||
source = Path(__file__).resolve().parents[1] / "apps/vps-host/ndc_vps/__init__.py"
|
||||
module = ast.parse(source.read_text())
|
||||
version = next(
|
||||
ast.literal_eval(n.value)
|
||||
for n in module.body
|
||||
if isinstance(n, ast.Assign)
|
||||
and any(isinstance(t, ast.Name) and t.id == "VERSION" for t in n.targets)
|
||||
)
|
||||
source = Path(__file__).resolve().parent / "fixtures/arnavi_vps/client-v1.json"
|
||||
version = json.loads(source.read_text())["server_version"]
|
||||
hosts, _, host = context()
|
||||
host["status"]["version"] = version
|
||||
assert apply(hosts, "device", 1) == {"ok": True}
|
||||
|
||||
Reference in New Issue
Block a user