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 '--'")
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)
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)
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)
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)
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 '--'")