Exemplo n.º 1
0
 def testConvertToPosixArgsVerboseArguments(self):
     """
     convert_to_posix_args uses proper '--' for verbose arguments
     """
     args = convert_to_posix_args(aa=True)
     self.assertEqual('--aa', args[0],
                      "verbose posix arguments must start with '--'")
Exemplo n.º 2
0
 def testConvertToPosixArgsFiltersFalsyValues(self):
     """
     convert_to_posix_args filters out falsy values from kwargs.
     """
     args = convert_to_posix_args(a=True, b=1, c=0, d=False, e="", aa=True, bb=1, cc=0, dd=False, ee="")
     self.assertIn("-a", args)
     self.assertIn("-b", args)
     self.assertIn("--aa", args)
     self.assertIn("--bb", args)
Exemplo n.º 3
0
 def testConvertToPosixArgsKeepsNonBooleanValues(self):
     """
     convert_to_posix_args keeps all non-bool values
     """
     args = convert_to_posix_args(a=True,
                                  b=1,
                                  c='c_v',
                                  aa=True,
                                  bb=1,
                                  cc='cc_v')
     self.assertItemsEqual(('-a', '-b', '1', '-c', 'c_v', '--aa', '--bb',
                            '1', '--cc', 'cc_v'), args)
Exemplo n.º 4
0
 def testConvertToPosixArgsFiltersFalsyValues(self):
     """
     convert_to_posix_args filters out falsy values from kwargs.
     """
     args = convert_to_posix_args(a=True,
                                  b=1,
                                  c=0,
                                  d=False,
                                  e='',
                                  aa=True,
                                  bb=1,
                                  cc=0,
                                  dd=False,
                                  ee='')
     self.assertIn('-a', args)
     self.assertIn('-b', args)
     self.assertIn('--aa', args)
     self.assertIn('--bb', args)
Exemplo n.º 5
0
 def testConvertToPosixArgsKeepsNonBooleanValues(self):
     """
     convert_to_posix_args keeps all non-bool values
     """
     args = convert_to_posix_args(a=True, b=1, c="c_v", aa=True, bb=1, cc="cc_v")
     self.assertItemsEqual(("-a", "-b", "1", "-c", "c_v", "--aa", "--bb", "1", "--cc", "cc_v"), args)
Exemplo n.º 6
0
 def testConvertToPosixArgsVerboseArguments(self):
     """
     convert_to_posix_args uses proper '--' for verbose arguments
     """
     args = convert_to_posix_args(aa=True)
     self.assertEqual("--aa", args[0], "verbose posix arguments must start with '--'")