Exemplo n.º 1
0
 def test_kwargs_json_empty_dict(self):
     parsed_args = {'kind': 'noop', 'uri': None,
                    'kwargs': [('empty', 'json:{}')]}
     runnable = nrunner.runnable_from_args(parsed_args)
     self.assertEqual(runnable.kind, 'noop')
     self.assertIsNone(runnable.uri)
     self.assertEqual(runnable.kwargs.get('empty'), {})
Exemplo n.º 2
0
 def test_exec_args(self):
     parsed_args = {'kind': 'exec', 'uri': '/path/to/executable',
                    'arg': ['-a', '-b', '-c']}
     runnable = nrunner.runnable_from_args(parsed_args)
     self.assertEqual(runnable.kind, 'exec')
     self.assertEqual(runnable.uri, '/path/to/executable')
     self.assertEqual(runnable.args, ('-a', '-b', '-c'))
     self.assertEqual(runnable.kwargs, {})
Exemplo n.º 3
0
 def test_exec_args_kwargs(self):
     parsed_args = {'kind': 'exec', 'uri': '/path/to/executable',
                    'arg': ['-a', '-b', '-c'],
                    'kwargs': [('DEBUG', '1'), ('LC_ALL', 'C')]}
     runnable = nrunner.runnable_from_args(parsed_args)
     self.assertEqual(runnable.kind, 'exec')
     self.assertEqual(runnable.uri, '/path/to/executable')
     self.assertEqual(runnable.args, ('-a', '-b', '-c'))
     self.assertEqual(runnable.kwargs.get('DEBUG'), '1')
     self.assertEqual(runnable.kwargs.get('LC_ALL'), 'C')
Exemplo n.º 4
0
 def test_kwargs_json_dict(self):
     parsed_args = {
         'kind': 'noop', 'uri': None,
         'kwargs': [('tags', 'json:{"arch": ["x86_64", "ppc64"]}'),
                    ('hi', 'json:"hello"')]
     }
     runnable = nrunner.runnable_from_args(parsed_args)
     self.assertEqual(runnable.kind, 'noop')
     self.assertIsNone(runnable.uri)
     self.assertEqual(runnable.kwargs.get('hi'), 'hello')
     self.assertEqual(runnable.tags.get('arch'), ["x86_64", "ppc64"])
Exemplo n.º 5
0
def subcommand_task_run(args, echo=print):
    runnable = runnable_from_args(args)
    task = Task(args.get('identifier'), runnable,
                args.get('status_uri', []))
    task.capables = RUNNABLE_KIND_CAPABLE
    task_run(task, echo)
Exemplo n.º 6
0
def subcommand_runnable_run(args, echo=print):
    runnable = runnable_from_args(args)
    runner = runner_from_runnable(runnable, RUNNABLE_KIND_CAPABLE)

    for status in runner.run():
        echo(status)
Exemplo n.º 7
0
 def test_noop(self):
     parsed_args = {'kind': 'noop', 'uri': None}
     runnable = nrunner.runnable_from_args(parsed_args)
     self.assertEqual(runnable.kind, 'noop')
     self.assertIsNone(runnable.uri)