Docker container for Pytest (#901)

* Dockerize Pytest

* Fix auto-delete warning in delete file test

* Allow tests to be executed with a non-default home dir

* Use hostname for Docker container only if tests executed in Docker

* Update container entrypoint to pytest

* Re-format tests with black

* Define if the execution environment is a Docker container in env fixture

* Skip unsupported host bridge attachment test in Docker
This commit is contained in:
nucleogenic
2022-10-15 03:30:08 +01:00
committed by GitHub
parent a8ac6a06cf
commit 6514e24770
9 changed files with 59 additions and 21 deletions
+3 -3
View File
@@ -1,7 +1,6 @@
import uuid
from conftest import (
CFG_DIR,
FILE_SIZE_1_MIB,
STATUS_SUCCESS,
)
@@ -46,7 +45,7 @@ def test_show_named_drive_presets(http_client):
# route("/drive/cdrom", methods=["POST"])
def test_create_cdrom_properties_file(http_client):
def test_create_cdrom_properties_file(env, http_client):
file_name = f"{uuid.uuid4()}.iso"
response = http_client.post(
@@ -62,7 +61,7 @@ def test_create_cdrom_properties_file(http_client):
assert response.status_code == 200
assert response_data["status"] == STATUS_SUCCESS
assert response_data["messages"][0]["message"] == (
f"File created: {CFG_DIR}/{file_name}.properties"
f"File created: {env['cfg_dir']}/{file_name}.properties"
)
@@ -89,6 +88,7 @@ def test_create_image_with_properties_file(http_client, delete_file):
# Cleanup
delete_file(file_name)
# route("/sys/manpage", methods=["POST"])
def test_show_manpage(http_client):
response = http_client.get("/sys/manpage?app=rascsi")