6 from . import arvados_testutil as tutil
9 class ArvNormalizeTestCase(unittest.TestCase, tutil.VersionChecker):
10 def run_arv_normalize(self, args=[]):
11 p = subprocess.Popen([sys.executable, 'bin/arv-normalize'] + args,
12 stdout=subprocess.PIPE,
13 stderr=subprocess.PIPE)
14 out, err = p.communicate()
15 sys.stdout.write(out.decode())
16 sys.stderr.write(err.decode())
19 def test_unsupported_arg(self):
20 with tutil.redirected_streams(
21 stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err):
22 returncode = self.run_arv_normalize(['-x=unknown'])
23 self.assertNotEqual(0, returncode)
25 def test_version_argument(self):
26 with tutil.redirected_streams(
27 stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err):
28 returncode = self.run_arv_normalize(['--version'])
29 self.assertVersionOutput(out, err)
30 self.assertEqual(0, returncode)