Beispiel #1
0
 def test_no_args(self):
     with self.assertRaises(SystemExit):
         create_parser([])
Beispiel #2
0
 def test_just_config(self):
     with self.assertRaises(SystemExit):
         create_parser(['-c', './gordian/config/ex_config.yaml', '--pr', ''])
Beispiel #3
0
 def test_all_args(self):
     args = create_parser(['-c', './gordian/config/ex_config.yaml', '-s', 'hello', '-r', 'goodbye', '--pr', 'test'])
     self.assertEqual(args.config_file, './gordian/config/ex_config.yaml')
     self.assertEqual(args.search, ['hello'])
     self.assertEqual(args.replace, ['goodbye'])
Beispiel #4
0
 def test_search_and_gordian(self):
     args = create_parser(['-s', 'hello', '-r', 'goodbye', '--pr', 'test'])
     self.assertEqual(args.config_file, 'config.yaml')
     self.assertEqual(args.search, ['hello'])
     self.assertEqual(args.replace, ['goodbye'])
Beispiel #5
0
 def test_config_and_repace(self):
     with self.assertRaises(SystemExit):
         create_parser(['-c', './gordian/config/ex_config.yaml', '-r', 'test'])
Beispiel #6
0
 def test_just_gordian(self):
     with self.assertRaises(SystemExit):
         create_parser(['-r', 'test'])
Beispiel #7
0
 def test_just_search(self):
     with self.assertRaises(SystemExit):
         create_parser(['-s', 'test'])