def test_flags_bad_combination(self):
   cmd = [
     '--bot', 'bot1:test1',
     '--testfilter', 'test2',
   ]
   options, args = trychange.gen_parser(None).parse_args(cmd)
   self.assertEquals([], args)
   try:
     # pylint: disable=W0212
     trychange._ParseSendChangeOptions(options)
     self.fail()
   except ValueError:
     pass
Beispiel #2
0
 def test_flags_bad_combination(self):
     cmd = [
         '--bot',
         'bot1:test1',
         '--testfilter',
         'test2',
     ]
     options, args = trychange.gen_parser(None).parse_args(cmd)
     self.assertEquals([], args)
     try:
         # pylint: disable=W0212
         trychange._ParseSendChangeOptions(options)
         self.fail()
     except ValueError:
         pass
Beispiel #3
0
 def test_flags(self):
     cmd = [
         '--bot',
         'bot1,bot2',
         '--testfilter',
         'test1',
         '--testfilter',
         'test2',
         '--user',
         'joe',
         '--email',
         '*****@*****.**',
     ]
     options, args = trychange.gen_parser(None).parse_args(cmd)
     self.assertEquals([], args)
     # pylint: disable=W0212
     bot_spec = trychange._ParseBotList(options.bot, options.testfilter)
     if options.testfilter:
         bot_spec = trychange._ApplyTestFilter(options.testfilter, bot_spec)
     values = trychange._ParseSendChangeOptions(bot_spec, options)
     self.assertEquals([
         ('user', 'joe'),
         ('name', None),
         ('email', '*****@*****.**'),
         ('bot', 'bot1:test1,test2'),
         ('bot', 'bot2:test1,test2'),
     ], values)
 def test_flags(self):
   cmd = [
     '--bot', 'bot1,bot2',
     '--testfilter', 'test1',
     '--testfilter', 'test2',
     '--user', 'joe',
     '--email', '*****@*****.**',
   ]
   options, args = trychange.gen_parser(None).parse_args(cmd)
   self.assertEquals([], args)
   # pylint: disable=W0212
   values = trychange._ParseSendChangeOptions(options)
   self.assertEquals(
       [
         ('user', 'joe'),
         ('name', None),
         ('email', '*****@*****.**'),
         ('bot', 'bot1:test1,test2'),
         ('bot', 'bot2:test1,test2'),
       ],
       values)