From a1ea0380d2cb001a708ed4a682f02852d7840005 Mon Sep 17 00:00:00 2001 From: German Date: Mon, 14 Mar 2022 12:05:05 +0100 Subject: [PATCH] Improving unit test for status --- tests/test_math.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/test_math.py b/tests/test_math.py index 838cf1c06b8..8196edf8bab 100755 --- a/tests/test_math.py +++ b/tests/test_math.py @@ -522,5 +522,16 @@ def test_repr(mm): assert mm._status == repr(mm) -def test_status(mm): - mm.status() +def test_status(mm, capsys): + assert mm.status() is None + captured = capsys.readouterr() + printed_output = captured.out + + assert "APDLMATH PARAMETER STATUS-" in printed_output + assert all( + [each in printed_output for each in ["Name", "Type", "Dims", "Workspace"]] + ) + + # Checking also _status property + assert "APDLMATH PARAMETER STATUS-" in mm._status + assert all([each in mm._status for each in ["Name", "Type", "Dims", "Workspace"]])