16811: Add a test that system users/groups can't be deleted.
[arvados.git] / sdk / python / tests / test_arv_copy.py
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 from __future__ import absolute_import
6 import os
7 import sys
8 import tempfile
9 import unittest
10
11 import arvados.commands.arv_copy as arv_copy
12 from . import arvados_testutil as tutil
13
14 class ArvCopyTestCase(unittest.TestCase, tutil.VersionChecker):
15     def run_copy(self, args):
16         sys.argv = ['arv-copy'] + args
17         return arv_copy.main()
18
19     def test_unsupported_arg(self):
20         with self.assertRaises(SystemExit):
21             self.run_copy(['-x=unknown'])
22
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)