Skip to content

Commit

Permalink
Adding unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Jul 19, 2023
1 parent 423e301 commit b3987bf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,3 +570,29 @@ def test_vsel_iterable(mapdl, make_block):
assert np.allclose(
mapdl.vsel("S", "volu", "", [1, 2, 4], "", ""), np.array([1, 2, 4])
)


def test_WithInterativePlotting(mapdl, make_block):
mapdl.eplot(vtk=False)
jobname = mapdl.jobname.upper()

def filtering(file_name):
file_name = file_name.upper()
if file_name.startswith(jobname) and file_name.endswith(".PNG"):
return True
else:
return False

list_files = sorted([each for each in mapdl.list_files() if filtering(each)])
last_png = list_files[0]

if mapdl.is_local:
last_png = os.path.join(mapdl.directory, last_png)
else:
mapdl.download(last_png)

# the file size will be 3kb if the image is empty.
assert os.path.getsize(last_png) // 1024 > 4 # kbs

# cleaning
os.remove(last_png)

0 comments on commit b3987bf

Please sign in to comment.