コード例 #1
0
 def testAddOptionAndValue(self):
   """Tests adding an option with a value."""
   self.assertListEqual(
       ['brillo', 'chroot', '--brick', '//foo', 'ls'],
       commandline._AddCliCommandOption(['brillo', 'chroot', 'ls'],
                                        '--brick', '//foo'))
コード例 #2
0
 def testInvalidArg(self):
   """Tests that trying to add a positional arg fails."""
   with self.assertRaises(ValueError):
     commandline._AddCliCommandOption(['brillo', 'chroot', 'ls'], 'positional')
コード例 #3
0
 def testAddOption(self):
   """Tests adding an option without a value."""
   self.assertListEqual(
       ['brillo', 'chroot', '--debug', 'ls'],
       commandline._AddCliCommandOption(['brillo', 'chroot', 'ls'], '--debug'))