1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
10 from . import arvados_testutil as tutil
13 class ArvNormalizeTestCase(unittest.TestCase, tutil.VersionChecker):
14 def run_arv_normalize(self, args=[]):
15 p = subprocess.Popen([sys.executable, 'bin/arv-normalize'] + args,
16 stdout=subprocess.PIPE,
17 stderr=subprocess.PIPE)
18 out, err = p.communicate()
19 sys.stdout.write(out.decode())
20 sys.stderr.write(err.decode())
23 def test_unsupported_arg(self):
24 with tutil.redirected_streams(
25 stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err):
26 returncode = self.run_arv_normalize(['-x=unknown'])
27 self.assertNotEqual(0, returncode)
29 def test_version_argument(self):
30 with tutil.redirected_streams(
31 stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err):
32 returncode = self.run_arv_normalize(['--version'])
33 self.assertVersionOutput(out, err)
34 self.assertEqual(0, returncode)