Skip to content

Commit

Permalink
test: check the images produced by the GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
kalekundert committed Jan 31, 2022
1 parent 1584728 commit a6fe696
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,25 @@ def test_show(layout, attrs, color, tol, expected, error):
indirect=['layout'],
)
def test_cli(layout, attrs, color, expected, tol, error, tmp_path):
actual = layout.parent / expected
expected = REF_IMAGES / expected
stdout = error.messages if error else 'Layout written'
cmd = ['wellmap', layout]

if error:
cmd += ['-f']
stdout = error.messages
else:
actual = layout.parent / expected
expected = REF_IMAGES / expected
cmd += ['-o', actual]
stdout = 'Layout written'

cmd = ['wellmap', layout, '-o', actual]
if attrs:
cmd += ([attrs] if isinstance(attrs, str) else attrs)
if color:
cmd += ['-c', color]

run_cli(cmd, stdout)
if not error:
compare_images(expected, actual, TEST_IMAGES, tol=tol)

plt.close()

0 comments on commit a6fe696

Please sign in to comment.