From ef6904ccd777c3fbf83376bc776dcbd23e0931ce Mon Sep 17 00:00:00 2001 From: Mihail Shinder Date: Fri, 19 Nov 2021 13:40:25 +0200 Subject: [PATCH] Add test for CommandViewer --- Tests/test_imageshow.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Tests/test_imageshow.py b/Tests/test_imageshow.py index 5981e22c0..07e2100e8 100644 --- a/Tests/test_imageshow.py +++ b/Tests/test_imageshow.py @@ -67,6 +67,18 @@ def test_viewers(): except NotImplementedError: pass +def test_commandviewer(): + if is_win32(): + basecmd = + 'start "Pillow" /WAIT "{file}" ' + "&& ping -n 2 127.0.0.1 >NUL " + '&& del /f "{file}"' + else: + # Not guessing command, just deleting + basecmd = "rm -f {file}" + viewer = ImageShow.CommandViewer() + im = hopper() + assert viewer.show(im, command=basecmd) == 1 def test_ipythonviewer(): pytest.importorskip("IPython", reason="IPython not installed")