Working log streaming

This commit is contained in:
Qubasa
2023-09-27 02:11:13 +02:00
committed by Mic92
parent da571dff7f
commit 7c93962e35
3 changed files with 6 additions and 6 deletions

View File

@@ -3,7 +3,6 @@ from pathlib import Path
import pytest
from api import TestClient
# @pytest.mark.impure
# def test_inspect(api: TestClient, test_flake_with_core: Path) -> None:
# response = api.post(
@@ -43,7 +42,8 @@ def test_create(api: TestClient, test_flake_with_core: Path) -> None:
response = api.get(f"/api/vms/{uuid}/logs")
print("=========LOGS==========")
for line in response.stream:
print(f"line: {line}")
assert line != b"", "Failed to get vm logs"
assert response.status_code == 200, "Failed to get vm logs"
print(line.decode("utf-8"), end="")
print("=========END LOGS==========")
assert response.status_code == 200, "Failed to get vm logs"
time.sleep(10)