def _expand_braced_args(self, args): arguments = [] for arg in args: if isinstance(arg, (ExpandStringArgument, StringArgument)): try: expanded_args = brace_expansion.expand_braces(arg._string) arguments.extend([arg.__class__(part) for part in expanded_args]) continue except parse.ParseException: pass arguments.append(arg) return arguments
def test(argument, expected): result = " ".join(brace_expansion.expand_braces(argument)) self.assertEquals(result, expected)