Skip to content

Commit 99972da

Browse files
authored
Return all the subtitles even if they are empty. (#2017)
* Return all the subtitles even if they are empty. * Fixing test
1 parent 6b4f020 commit 99972da

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/ansys/mapdl/core/misc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,7 @@ def load_step_options(self):
929929

930930
def _get_between(self, init_string, end_string=None, string=None):
931931
if not string:
932+
self._update()
932933
string = self._stats
933934

934935
st = string.find(init_string) + len(init_string)
@@ -959,8 +960,9 @@ def _get_title(self):
959960
def _get_stitles(self):
960961
return [
961962
re.search(f"SUBTITLE {i}=(.*)", self._get_titles()).groups(1)[0].strip()
962-
for i in range(1, 5)
963963
if re.search(f"SUBTITLE {i}=(.*)", self._get_titles())
964+
else ""
965+
for i in range(1, 5)
964966
]
965967

966968
def _get_products(self):

tests/test_misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def test_info_title(mapdl):
150150
def test_info_stitle(mapdl):
151151
info = mapdl.info
152152

153-
assert not info.stitles
153+
assert all([not each for each in info.stitles])
154154
stitles = ["asfd", "qwer", "zxcv", "jkl"]
155155
info.stitles = "\n".join(stitles)
156156

@@ -162,7 +162,7 @@ def test_info_stitle(mapdl):
162162
assert stitles == info.stitles
163163

164164
info.stitles = None
165-
assert not info.stitles
165+
assert all([not each for each in info.stitles])
166166

167167

168168
@pytest.mark.parametrize("file_", ["dummy.dumdum", "dumdum.dummy"])

0 commit comments

Comments
 (0)