예제 #1
0
파일: test_goal.py 프로젝트: sheltowt/pants
  def test_parse_args(self):
    self.assert_result(goals=[], specs=[], args=[])
    self.assert_result(goals=[], specs=[], args=['--'])
    self.assert_result(goals=[], specs=[], args=['-v', '--help'])

    self.assert_result(goals=['compile'], specs=[], args=['compile', '--log'])
    self.assert_result(goals=['compile', 'test'], specs=[], args=['compile', 'test'])
    self.assert_result(goals=['compile', 'test'], specs=[], args=['compile', '-v', 'test'])

    self.assert_result(goals=[], specs=['resolve'], args=['--', 'resolve', '--ivy-open'])
    self.assert_result(goals=['test'], specs=['resolve'], args=['test', '--', 'resolve',
                                                                '--ivy-open'])

    try:
      GoalRunner.parse_args(['test', 'lib:all', '--', 'resolve'])
      self.fail('Expected mixed specs and goals to the left of an explicit '
                'multi-goal sep (--) to be rejected.')
    except GoalRunner.IntermixedArgumentsError:
      pass # expected

    try:
      GoalRunner.parse_args(['resolve', 'lib/all', 'test', '--'])
      self.fail('Expected mixed specs and goals to the left of an explicit '
                'multi-goal sep (--) to be rejected.')
    except GoalRunner.IntermixedArgumentsError:
      pass # expected

    self.assert_result(goals=['test'], specs=['lib:all'], args=['lib:all', '-v', 'test'])
    self.assert_result(goals=['test'], specs=['lib/'], args=['-v', 'test', 'lib/'])
    self.assert_result(goals=['test'], specs=['lib/io:sound'], args=['test', '-v', 'lib/io:sound'])
    self.assert_result(goals=['test'], specs=['lib:all'], args=['-h', 'test', '-v', 'lib:all',
                                                                '-x'])
예제 #2
0
파일: test_goal.py 프로젝트: sheltowt/pants
 def assert_result(self, goals, specs, args):
   g, s = GoalRunner.parse_args(args)
   self.assertEquals((goals, specs), (list(g), list(s)))
예제 #3
0
파일: test_goal.py 프로젝트: Yasumoto/pants
 def assert_result(self, goals, specs, args, fail_fast=False):
   g, s, ff = GoalRunner.parse_args(args)
   self.assertEquals((goals, specs, fail_fast), (list(g), list(s), ff))