Example #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', 'μμ'])
Example #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', 'μμ'])
Example #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
Example #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
Example #5
0
 def test_split_command_with_bytes(self):
     self.assertEqual(split_command('echo μμ'), ['echo', 'μμ'])
Example #6
0
 def test_split_command_with_unicode(self):
     self.assertEqual(split_command(u'echo μμ'), ['echo', 'μμ'])
Example #7
0
 def test_split_command_with_bytes(self):
     expected = ['echo', u'μ'.encode('utf-8')]
     self.assertEqual(split_command(u'echo μ'), expected)
Example #8
0
 def test_split_command_with_bytes(self):
     self.assertEqual(split_command('echo μμ'), ['echo', 'μμ'])
Example #9
0
 def test_split_command_with_bytes(self):
     expected = ['echo', u'μ'.encode('utf-8')]
     self.assertEqual(split_command(u'echo μ'), expected)
Example #10
0
 def test_split_command_with_bytes(self):
     self.assertEqual(split_command("echo μμ"), ["echo", "μμ"])
Example #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", "μμ"])
Example #12
0
 def test_split_command_with_bytes(self):
     assert split_command('echo μμ') == ['echo', 'μμ']
Example #13
0
 def test_split_command_with_unicode(self):
     assert split_command(u'echo μμ') == ['echo', 'μμ']
Example #14
0
 def test_split_command_with_unicode(self):
     assert split_command(u'echo μμ') == ['echo', 'μμ']
Example #15
0
 def test_split_command_with_unicode(self):
     self.assertEqual(split_command(u'echo μμ'), ['echo', 'μμ'])
Example #16
0
 def test_split_command_with_bytes(self):
     assert split_command('echo μμ') == ['echo', 'μμ']
Example #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'])})