3 from __future__ import absolute_import
10 import arvados.errors as arv_error
11 import arvados.commands.ws as arv_ws
12 from . import arvados_testutil as tutil
14 class ArvWsTestCase(unittest.TestCase):
15 def run_ws(self, args):
16 return arv_ws.main(args)
18 def test_unsupported_arg(self):
19 with self.assertRaises(SystemExit):
20 self.run_ws(['-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_ws(['--version'])
28 self.assertEqual(out.getvalue(), '')
29 self.assertRegexpMatches(err.getvalue(), "[0-9]+\.[0-9]+\.[0-9]+")