Test if stderr is in output

This commit is contained in:
erik 2023-07-12 13:02:03 +02:00
parent 0a9efe85d2
commit 8cb17dea54

View file

@ -1,4 +1,5 @@
from pybuilder.core import Project from pybuilder.core import Project
from subprocess import Popen, PIPE, run
from pathlib import Path from pathlib import Path
from src.main.python.ddadevops.domain import ( from src.main.python.ddadevops.domain import (
BuildType, BuildType,
@ -12,3 +13,12 @@ def test_devops_build_commons_path():
assert image is not None assert image is not None
assert image.is_valid() assert image.is_valid()
assert "docker/" == image.build_commons_path() assert "docker/" == image.build_commons_path()
def test_docker_fails_with_error_msg():
output = run(
f"docker build asdfsdf",
shell=True,
check=True,
stderr=PIPE,
text=True
).stderr