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.commands.arv_copy as arv_copy
12 from . import arvados_testutil as tutil
14 class ArvCopyTestCase(unittest.TestCase, tutil.VersionChecker):
15 def run_copy(self, args):
16 sys.argv = ['arv-copy'] + args
17 return arv_copy.main()
19 def test_unsupported_arg(self):
20 with self.assertRaises(SystemExit):
21 self.run_copy(['-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_copy(['--version'])
28 self.assertVersionOutput(out, err)