[ARVADOS] updated: e994ac99adab1a388104d03b90544d19526a6c47

git at public.curoverse.com git at public.curoverse.com
Mon Dec 14 14:09:25 EST 2015


Summary of changes:
 services/fuse/tests/test_command_args.py | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

       via  e994ac99adab1a388104d03b90544d19526a6c47 (commit)
      from  bf234475965f5908355435b246ac696c35d54556 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e994ac99adab1a388104d03b90544d19526a6c47
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Dec 14 14:09:20 2015 -0500

    7939: Check exit code in tests.

diff --git a/services/fuse/tests/test_command_args.py b/services/fuse/tests/test_command_args.py
index 8f040bc..1897e8e 100644
--- a/services/fuse/tests/test_command_args.py
+++ b/services/fuse/tests/test_command_args.py
@@ -205,21 +205,24 @@ class MountErrorTest(unittest.TestCase):
     def test_no_token(self):
         del arvados.config._settings["ARVADOS_API_TOKEN"]
         arvados.config._settings = {}
-        with self.assertRaises(SystemExit):
+        with self.assertRaises(SystemExit) as ex:
             args = arvados_fuse.command.ArgumentParser().parse_args([self.mntdir])
             arvados_fuse.command.Mount(args, logger=self.logger).run()
+        self.assertEqual(1, ex.exception.code)
 
     def test_no_host(self):
         del arvados.config._settings["ARVADOS_API_HOST"]
-        with self.assertRaises(SystemExit):
+        with self.assertRaises(SystemExit) as ex:
             args = arvados_fuse.command.ArgumentParser().parse_args([self.mntdir])
             arvados_fuse.command.Mount(args, logger=self.logger).run()
+        self.assertEqual(1, ex.exception.code)
 
     def test_bogus_host(self):
         arvados.config._settings["ARVADOS_API_HOST"] = "example.null"
-        with self.assertRaises(SystemExit):
+        with self.assertRaises(SystemExit) as ex:
             args = arvados_fuse.command.ArgumentParser().parse_args([self.mntdir])
             arvados_fuse.command.Mount(args, logger=self.logger).run()
+        self.assertEqual(1, ex.exception.code)
 
     def test_bogus_mount_dir(self):
         # All FUSE errors in llfuse.init() are raised as RuntimeError
@@ -234,18 +237,21 @@ class MountErrorTest(unittest.TestCase):
         # The user specified --allow-other but user_allow_other is not set
         # in /etc/fuse.conf
         os.rmdir(self.mntdir)
-        with self.assertRaises(SystemExit):
+        with self.assertRaises(SystemExit) as ex:
             args = arvados_fuse.command.ArgumentParser().parse_args([self.mntdir])
             arvados_fuse.command.Mount(args, logger=self.logger).run()
+        self.assertEqual(1, ex.exception.code)
 
     def test_unreadable_collection(self):
-        with self.assertRaises(SystemExit):
+        with self.assertRaises(SystemExit) as ex:
             args = arvados_fuse.command.ArgumentParser().parse_args([
                 "--collection", "zzzzz-4zz18-zzzzzzzzzzzzzzz", self.mntdir])
             arvados_fuse.command.Mount(args, logger=self.logger).run()
+        self.assertEqual(1, ex.exception.code)
 
     def test_unreadable_project(self):
-        with self.assertRaises(SystemExit):
+        with self.assertRaises(SystemExit) as ex:
             args = arvados_fuse.command.ArgumentParser().parse_args([
                 "--project", "zzzzz-j7d0g-zzzzzzzzzzzzzzz", self.mntdir])
             arvados_fuse.command.Mount(args, logger=self.logger).run()
+        self.assertEqual(1, ex.exception.code)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list