Example #1
0
 def test_run_common_function(self, mock_command):
     Shell.run_common_function('foo', ['"param1"', '"param2"'])
     command_string = ' '.join([
         'source',
         Defaults.project_file('config/functions.sh') + ';', 'foo',
         '"param1"', '"param2"'
     ])
     mock_command.assert_called_once_with(['bash', '-c', command_string])
Example #2
0
 def test_run_common_function(self, mock_command):
     Shell.run_common_function('foo', ['"param1"', '"param2"'])
     command_string = ' '.join(
         [
             'source', Defaults.project_file('config/functions.sh') + ';',
             'foo', '"param1"', '"param2"'
         ]
     )
     mock_command.assert_called_once_with(
         ['bash', '-c', command_string]
     )
Example #3
0
 def test_quote_key_value_file(self):
     assert Shell.quote_key_value_file('../data/key_value') == [
         "foo='bar'",
         "bar='xxx'",
         "name='bob'",
         "strange='$a_foo'"
     ]
Example #4
0
 def test_quote_key_value_file(self):
     assert Shell.quote_key_value_file('../data/key_value') == [
         "foo='bar'", "bar='xxx'", "name='bob'", "strange='$a_foo'"
     ]
Example #5
0
 def test_quote(self):
     assert Shell.quote('aa\!') == 'aa\\\\\\!'
Example #6
0
 def test_quote(self):
     assert Shell.quote('aa\!') == 'aa\\\\\\!'