1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
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, tutil.VersionChecker):
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):
23 with tutil.redirected_streams(
24 stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err):
25 with self.assertRaises(SystemExit):
26 self.run_ws(['--version'])
27 self.assertVersionOutput(out, err)