2 # -*- coding: utf-8 -*-
10 import arvados.commands.arv_copy as arv_copy
11 import arvados_testutil as tutil
13 class ArvCopyTestCase(unittest.TestCase):
14 def run_copy(self, args):
15 sys.argv = ['arv-copy'] + args
16 return arv_copy.main()
18 def test_unsupported_arg(self):
19 with self.assertRaises(SystemExit):
20 self.run_copy(['-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_copy(['--version'])
28 self.assertEqual(out.getvalue(), '')
29 self.assertRegexpMatches(err.getvalue(), "[0-9]+\.[0-9]+\.[0-9]+")