Пример #1
0
 def test_run_subprocess_no_python(self):
     parsed = docparse.parse_message('ro_bot shell', BOTNAME, 'robot_bot')
     properties, command, arguments = parsed
     self.assertIn(
         'success',
         docparse.run_subprocess(command, arguments, -1,
                                 properties)[0]['content'])
Пример #2
0
 def test_run_subprocess_help_dashdash_substitution(self):
     parsed = docparse.parse_message(f'ro_bot {test_script_python} —help',
                                     BOTNAME, 'robot_bot')
     properties, command, arguments = parsed
     self.assertIn(
         python.help_message,
         docparse.run_subprocess(command, arguments, -1,
                                 properties)[0]['content'])
Пример #3
0
 def test_run_subprocess(self):
     parsed = docparse.parse_message(
         f'ro_bot {test_script_python} test-arg', BOTNAME, 'robot_bot')
     properties, command, arguments = parsed
     self.assertIn(
         python.output_message,
         docparse.run_subprocess(command, arguments, -1,
                                 properties)[0]['content'])
Пример #4
0
 def test_run_subprocess_large_output(self):
     parsed = docparse.parse_message('ro_bot large_output', BOTNAME,
                                     'robot_bot')
     properties, command, arguments = parsed
     error_message = list(
         docparse.run_subprocess(command, arguments, -1,
                                 properties))[1]['content']
     self.assertIn("output size of MAX_PROCESS_OUTPUT", error_message)
Пример #5
0
    def test_run_subprocess_timeout(self):
        parsed = docparse.parse_message('ro_bot timeout', BOTNAME, 'robot_bot')
        properties, command, arguments = parsed

        error_message = list(
            docparse.run_subprocess(command, arguments, -1,
                                    properties))[0]['content']
        self.assertIn(f"{properties['timeout']} seconds", error_message)
Пример #6
0
 def test_run_subprocess_json(self):
     parsed = docparse.parse_message('ro_bot json', BOTNAME, 'robot_bot')
     properties, command, arguments = parsed
     for obj in docparse.run_subprocess(command, arguments, -1, properties):
         self.assertEqual(obj['type'], 'print')
         self.assertEqual(obj['content'], 'success')