コード例 #1
0
ファイル: branch_unit_test.py プロジェクト: yan-zay/chromium
 def test_initialize_parse_args(self):
     args = branch.parse_args(
         ['initialize', '--milestone', 'MM', '--branch', 'BBBB'],
         parser_type=ArgumentParser)
     self.assertEqual(args.milestone, 'MM')
     self.assertEqual(args.branch, 'BBBB')
コード例 #2
0
ファイル: branch_unit_test.py プロジェクト: yan-zay/chromium
 def test_initialize_parse_args_fails_when_missing_required_args(self):
     with self.assertRaises(ParseError) as caught:
         branch.parse_args(['initialize'], parser_type=ArgumentParser)
     self.assertEqual(
         str(caught.exception),
         'the following arguments are required: --milestone, --branch')
コード例 #3
0
ファイル: branch_unit_test.py プロジェクト: yan-zay/chromium
 def test_parse_args_fails_without_subcommand(self):
     with self.assertRaises(ParseError) as caught:
         branch.parse_args([], parser_type=ArgumentParser)
     self.assertEqual(str(caught.exception), 'no sub-command specified')
コード例 #4
0
 def test_set_type_parse_args(self):
   args = branch.parse_args(
       ['set-type', '--type', 'desktop-extended-stable', '--type', 'cros-lts'])
   self.assertEqual(args.type, ['desktop-extended-stable', 'cros-lts'])
コード例 #5
0
 def test_set_type_parse_args_fails_for_invalid_type(self):
   with self.assertRaises(ParseError) as caught:
     branch.parse_args(['set-type', '--type', 'foo'],
                       parser_type=ArgumentParser)
   self.assertIn("invalid choice: 'foo'", str(caught.exception))
コード例 #6
0
 def test_set_type_parse_args(self):
     args = branch.parse_args(['set-type', '--type', 'lts'])
     self.assertEqual(args.type, 'lts')