2 # -*- coding: utf-8 -*-
10 class ArvNormalizeTestCase(unittest.TestCase):
11 def run_arv_normalize(self, args=[]):
12 p = subprocess.Popen([sys.executable, 'bin/arv-normalize'] + args,
13 stdout=subprocess.PIPE,
14 stderr=subprocess.PIPE)
15 (stdout, stderr) = p.communicate()
16 return p.returncode, stdout, stderr
18 def test_unsupported_arg(self):
19 returncode, out, err = self.run_arv_normalize(['-x=unknown'])
20 self.assertNotEqual(0, returncode)
22 def test_version_argument(self):
23 returncode, out, err = self.run_arv_normalize(['--version'])
24 self.assertEqual(0, returncode)
25 self.assertEqual('', out)
26 self.assertNotEqual('', err)
27 self.assertRegexpMatches(err, "[0-9]+\.[0-9]+\.[0-9]+")