示例#1
0
    def test_format_command_with_pairs(self):
        ret = format_command('echo {0}', [[1], [2], [3], [4]])

        self.assertEqual(ret, ['echo 1', 'echo 2', 'echo 3', 'echo 4'])
示例#2
0
    def test_format_command_raises_runtimeerror_when_invalid_amount_of_arguments(self):
	with self.assertRaises(RuntimeError):
	    format_command('echo {0} {1}', [[1]])
示例#3
0
 def test_format_command_formats_command_in_right_order(self):
     ret = format_command('echo {3} {1} {2} {0}', [[1, 2, 3, 4]])
     
     self.assertEqual(ret, ['echo 4 2 3 1'])