9 import arvados.errors as arv_error
10 import arvados.commands.ws as arv_ws
11 import arvados_testutil as tutil
13 class ArvWsTestCase(unittest.TestCase):
14 def run_ws(self, args):
15 return arv_ws.main(args)
17 def test_unsupported_arg(self):
18 with self.assertRaises(SystemExit):
19 self.run_ws(['-x=unknown'])
21 def test_version_argument(self):
24 with tutil.redirected_streams(stdout=out, stderr=err):
25 with self.assertRaises(SystemExit):
26 self.run_ws(['--version'])
27 self.assertEqual(out.getvalue(), '')
28 self.assertRegexpMatches(err.getvalue(), "[0-9]+\.[0-9]+\.[0-9]+")