Exemplo n.º 1
0
 def test_process_init_default(self):
     process = Process()
     self.assertEqual(process.command, '')
     self.assertAlmostEqual(len(process.arguments), 0)
Exemplo n.º 2
0
    def test_process_stringCast(self):

        checkString = 'Command: command\nArguments:\n0: arg\n1: arg1\n'

        process = Process('command', ['arg', 'arg1'])
        self.assertEqual(str(process), checkString)
Exemplo n.º 3
0
    def test_process_stringCast_noArgs(self):

        checkString = 'Command: command\nArguments:\n'

        process = Process('command', [])
        self.assertEqual(str(process), checkString)
Exemplo n.º 4
0
 def test_process_oneArgString(self):
     process = Process('command', 'arg')
     self.assertEqual(process.command, 'command', 'Command Incorrect')
     self.assertEqual(len(process.arguments), 1,
                      'Number of Arguments Incorrect')
     self.assertEqual(process.arguments[0], 'arg', 'String Not Handled')
Exemplo n.º 5
0
 def test_process_namedArg(self):
     process = Process(args=['argument', 'argument1'])
     self.assertEqual(process.command, '')
     self.assertEqual(len(process.arguments), 2)
     self.assertEqual(process.arguments[0], 'argument')
     self.assertEqual(process.arguments[1], 'argument1')
Exemplo n.º 6
0
 def test_process_twoArg(self):
     process = Process('command', ['argument', 'argument1'])
     self.assertEqual(len(process.arguments), 2)
     self.assertEqual(process.arguments[0], 'argument')
     self.assertEqual(process.arguments[1], 'argument1')
Exemplo n.º 7
0
 def test_process_oneArg(self):
     process = Process('command', ['argument'])
     self.assertEqual(len(process.arguments), 1)
     self.assertEqual(process.arguments[0], 'argument')
Exemplo n.º 8
0
 def test_process_command(self):
     process = Process('command')
     self.assertEqual(process.command, 'command')
     self.assertEqual(len(process.arguments), 0)