From 8cb17dea545933d892fab1f84e9d1e13aab476a6 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 12 Jul 2023 13:02:03 +0200 Subject: [PATCH] Test if stderr is in output --- src/test/python/domain/test_image.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/python/domain/test_image.py b/src/test/python/domain/test_image.py index e26c98d..45ca8ad 100644 --- a/src/test/python/domain/test_image.py +++ b/src/test/python/domain/test_image.py @@ -1,4 +1,5 @@ from pybuilder.core import Project +from subprocess import Popen, PIPE, run from pathlib import Path from src.main.python.ddadevops.domain import ( BuildType, @@ -12,3 +13,12 @@ def test_devops_build_commons_path(): assert image is not None assert image.is_valid() 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