21356: Remove all Python 2/3 compatibility imports
[arvados.git] / sdk / python / tests / test_arv_ws.py
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 import os
6 import sys
7 import tempfile
8 import unittest
9
10 import arvados.errors as arv_error
11 import arvados.commands.ws as arv_ws
12 from . import arvados_testutil as tutil
13
14 class ArvWsTestCase(unittest.TestCase, tutil.VersionChecker):
15     def run_ws(self, args):
16         return arv_ws.main(args)
17
18     def test_unsupported_arg(self):
19         with self.assertRaises(SystemExit):
20             self.run_ws(['-x=unknown'])
21
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)