2 # -*- coding: utf-8 -*-
10 import arvados.commands.run as arv_run
11 import arvados_testutil as tutil
13 class ArvRunTestCase(unittest.TestCase):
14 def run_arv_run(self, args):
15 sys.argv = ['arv-run'] + args
18 def test_unsupported_arg(self):
19 with self.assertRaises(SystemExit):
20 self.run_arv_run(['-x=unknown'])
22 def test_version_argument(self):
25 with tutil.redirected_streams(stdout=out, stderr=err):
26 with self.assertRaises(SystemExit):
27 self.run_arv_run(['--version'])
28 self.assertEqual(out.getvalue(), '')
29 self.assertRegexpMatches(err.getvalue(), "[0-9]+\.[0-9]+\.[0-9]+")