2 # -*- coding: utf-8 -*-
9 from . import arvados_testutil as tutil
12 class ArvNormalizeTestCase(unittest.TestCase, tutil.VersionChecker):
13 def run_arv_normalize(self, args=[]):
14 p = subprocess.Popen([sys.executable, 'bin/arv-normalize'] + args,
15 stdout=subprocess.PIPE,
16 stderr=subprocess.PIPE)
17 out, err = p.communicate()
18 sys.stdout.write(out.decode())
19 sys.stderr.write(err.decode())
22 def test_unsupported_arg(self):
23 with tutil.redirected_streams(
24 stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err):
25 returncode = self.run_arv_normalize(['-x=unknown'])
26 self.assertNotEqual(0, returncode)
28 def test_version_argument(self):
29 with tutil.redirected_streams(
30 stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err):
31 returncode = self.run_arv_normalize(['--version'])
32 self.assertVersionOutput(out, err)
33 self.assertEqual(0, returncode)