Tests: USe namedtuple to pass verifier output for asserts

This commit is contained in:
Pragyansh Chaturvedi
2026-04-25 18:54:25 +05:30
parent 145e930389
commit 48fa8aec3f
2 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import subprocess
import uuid
from collections import namedtuple
from pathlib import Path
@ -17,7 +18,8 @@ def verify_object(obj_path: Path) -> tuple[bool, str]:
text=True,
timeout=30,
)
output = result.stdout + result.stderr
Output = namedtuple("Output", ["stdout", "stderr"])
output = Output(stdout=result.stdout, stderr=result.stderr)
return result.returncode == 0, output
except subprocess.TimeoutExpired:
return False, "bpftool timed out after 30s"