1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
5 from __future__ import absolute_import
11 import arvados.errors as arv_error
12 import arvados.commands.ws as arv_ws
13 from . import arvados_testutil as tutil
15 class ArvWsTestCase(unittest.TestCase, tutil.VersionChecker):
16 def run_ws(self, args):
17 return arv_ws.main(args)
19 def test_unsupported_arg(self):
20 with self.assertRaises(SystemExit):
21 self.run_ws(['-x=unknown'])
23 def test_version_argument(self):
24 with tutil.redirected_streams(
25 stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err):
26 with self.assertRaises(SystemExit):
27 self.run_ws(['--version'])
28 self.assertVersionOutput(out, err)