18870: Need to declare NODES as array
[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 from __future__ import absolute_import
6 import os
7 import sys
8 import tempfile
9 import unittest
10
11 import arvados.errors as arv_error
12 import arvados.commands.ws as arv_ws
13 from . import arvados_testutil as tutil
14
15 class ArvWsTestCase(unittest.TestCase, tutil.VersionChecker):
16     def run_ws(self, args):
17         return arv_ws.main(args)
18
19     def test_unsupported_arg(self):
20         with self.assertRaises(SystemExit):
21             self.run_ws(['-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_ws(['--version'])
28         self.assertVersionOutput(out, err)