def test_split_command_with_unicode(self): if six.PY2: self.assertEqual( split_command(unicode('echo μμ', 'utf-8')), ['echo', 'μμ'] ) else: self.assertEqual(split_command('echo μμ'), ['echo', 'μμ'])
def set_command_and_args(config, entrypoint, command): if isinstance(entrypoint, six.string_types): entrypoint = split_command(entrypoint) if isinstance(command, six.string_types): command = split_command(command) if entrypoint: config['Command'] = entrypoint + command return if command: config['Args'] = command
def test_split_command_with_bytes(self): self.assertEqual(split_command('echo μμ'), ['echo', 'μμ'])
def test_split_command_with_unicode(self): self.assertEqual(split_command(u'echo μμ'), ['echo', 'μμ'])
def test_split_command_with_bytes(self): expected = ['echo', u'μ'.encode('utf-8')] self.assertEqual(split_command(u'echo μ'), expected)
def test_split_command_with_bytes(self): self.assertEqual(split_command("echo μμ"), ["echo", "μμ"])
def test_split_command_with_unicode(self): if six.PY2: self.assertEqual(split_command(unicode("echo μμ", "utf-8")), ["echo", "μμ"]) else: self.assertEqual(split_command("echo μμ"), ["echo", "μμ"])
def test_split_command_with_bytes(self): assert split_command('echo μμ') == ['echo', 'μμ']
def test_split_command_with_unicode(self): assert split_command(u'echo μμ') == ['echo', 'μμ']
def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) if 'Command' in self and isinstance(self['Command'], str): self.update({'Command': split_command(self['Command'])})