Ejemplo n.º 1
0
 def test_create_grep_cmd(self):
     args = get_args()
     result = ackg.create_grep_cmd(args)
     self.assertEqual('', result)
     args = get_args(['foo'])
     result = ackg.create_grep_cmd(args)
     self.assertTrue(result.startswith('grep'), result)
     self.assertTrue(' --binary-files=without-match ' in result, result)
     self.assertTrue(' --color ' in result, result)
     self.assertTrue(' --line-number ' in result, result)
     self.assertTrue(' --with-filename ' in result, result)
Ejemplo n.º 2
0
 def test_create_grep_cmd_complex(self):
     args = get_args(['\(import.*distribution\|distribution.*import\)'])
     result = ackg.create_grep_cmd(args)
     self.assertTrue(
         '"\(import.*distribution\|distribution.*import\)"' in result,
         result)