Ejemplo n.º 1
0
 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', 'μμ'])
Ejemplo n.º 2
0
 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', 'μμ'])
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
 def test_split_command_with_bytes(self):
     self.assertEqual(split_command('echo μμ'), ['echo', 'μμ'])
Ejemplo n.º 6
0
 def test_split_command_with_unicode(self):
     self.assertEqual(split_command(u'echo μμ'), ['echo', 'μμ'])
Ejemplo n.º 7
0
 def test_split_command_with_bytes(self):
     expected = ['echo', u'μ'.encode('utf-8')]
     self.assertEqual(split_command(u'echo μ'), expected)
Ejemplo n.º 8
0
 def test_split_command_with_bytes(self):
     self.assertEqual(split_command('echo μμ'), ['echo', 'μμ'])
Ejemplo n.º 9
0
 def test_split_command_with_bytes(self):
     expected = ['echo', u'μ'.encode('utf-8')]
     self.assertEqual(split_command(u'echo μ'), expected)
Ejemplo n.º 10
0
 def test_split_command_with_bytes(self):
     self.assertEqual(split_command("echo μμ"), ["echo", "μμ"])
Ejemplo n.º 11
0
 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", "μμ"])
Ejemplo n.º 12
0
 def test_split_command_with_bytes(self):
     assert split_command('echo μμ') == ['echo', 'μμ']
Ejemplo n.º 13
0
 def test_split_command_with_unicode(self):
     assert split_command(u'echo μμ') == ['echo', 'μμ']
Ejemplo n.º 14
0
 def test_split_command_with_unicode(self):
     assert split_command(u'echo μμ') == ['echo', 'μμ']
Ejemplo n.º 15
0
 def test_split_command_with_unicode(self):
     self.assertEqual(split_command(u'echo μμ'), ['echo', 'μμ'])
Ejemplo n.º 16
0
 def test_split_command_with_bytes(self):
     assert split_command('echo μμ') == ['echo', 'μμ']
Ejemplo n.º 17
0
    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'])})