From 7c6ce4a870885d76aa42bc8b1d252e6645c71895 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Tue, 7 Nov 2017 17:52:04 +0000
Subject: [PATCH] A few more checks  in immv/imcp scripts

---
 tests/test_immv_imcp.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tests/test_immv_imcp.py b/tests/test_immv_imcp.py
index 4b83caf3a..85e2bb2ea 100644
--- a/tests/test_immv_imcp.py
+++ b/tests/test_immv_imcp.py
@@ -335,8 +335,8 @@ def test_imcp_script_shouldPass(move=False):
                 print('indir before:    ', os.listdir(indir))
                 print('outdir before:   ', os.listdir(outdir))
 
-                if move: immv_script.main(imcp_args)
-                else:    imcp_script.main(imcp_args)
+                if move: assert immv_script.main(imcp_args) == 0
+                else:    assert imcp_script.main(imcp_args) == 0
 
                 print('indir after:     ', os.listdir(indir))
                 print('outdir after:    ', os.listdir(outdir))
@@ -358,7 +358,6 @@ def test_imcp_script_shouldPass(move=False):
         shutil.rmtree(outdir)
 
 
-
 def test_imcp_script_shouldFail(move=False):
 
     # - len(srcs) > 1 and dest is not dir
@@ -453,6 +452,15 @@ def test_imcp_script_shouldFail(move=False):
         shutil.rmtree(indir)
         shutil.rmtree(outdir)
 
+    # Other failure cases
+    if move: assert immv_script.main()       != 0
+    else:    assert imcp_script.main()       != 0
+    if move: assert immv_script.main([])     != 0
+    else:    assert imcp_script.main([])     != 0
+    if move: assert immv_script.main(['wa']) != 0
+    else:    assert imcp_script.main(['wa']) != 0
+
+
 
 def test_immv_script_shouldPass():
     test_imcp_script_shouldPass(move=True)
-- 
GitLab