Ejemplo n.º 1
0
 def kwarg_builder(new_items, return_socket=False):
     mach_parsed_kwargs.update(new_items)
     runner = MarionetteTestRunner(**mach_parsed_kwargs)
     with patch('marionette_harness.runner.base.socket') as socket:
         built_kwargs = runner._build_kwargs()
     if return_socket:
         return built_kwargs, socket
     return built_kwargs
Ejemplo n.º 2
0
 def kwarg_builder(new_items, return_socket=False):
     mach_parsed_kwargs.update(new_items)
     runner = MarionetteTestRunner(**mach_parsed_kwargs)
     with patch('marionette_harness.runner.base.socket') as socket:
         built_kwargs = runner._build_kwargs()
     if return_socket:
         return built_kwargs, socket
     return built_kwargs
def test_parsing_optional_arguments(mach_parsed_kwargs, arg_name, arg_dest,
                                    arg_value, expected_value):
    parser = MarionetteArguments()
    parsed_args = parser.parse_args(['--' + arg_name, arg_value])
    result = vars(parsed_args)
    assert result.get(arg_dest) == expected_value
    mach_parsed_kwargs[arg_dest] = result[arg_dest]
    runner = MarionetteTestRunner(**mach_parsed_kwargs)
    built_kwargs = runner._build_kwargs()
    assert built_kwargs[arg_dest] == expected_value
def test_parse_opt_args_emulator(mach_parsed_kwargs, arg_name, arg_dest, arg_value, expected_value):
    parser = MarionetteArguments()
    parsed_args = parser.parse_args(['--' + arg_name, arg_value])
    result = vars(parsed_args)
    assert result.get(arg_dest) == expected_value
    mach_parsed_kwargs[arg_dest] = result[arg_dest]
    mach_parsed_kwargs["emulator"] = True
    runner = MarionetteTestRunner(**mach_parsed_kwargs)
    built_kwargs = runner._build_kwargs()
    assert built_kwargs[arg_dest] == expected_value
Ejemplo n.º 5
0
def test_parse_opt_args_emulator(mach_parsed_kwargs, arg_name, arg_dest,
                                 arg_value, expected_value):
    parser = MarionetteArguments()
    parsed_args = parser.parse_args(["--" + arg_name, arg_value])
    result = vars(parsed_args)
    assert result.get(arg_dest) == expected_value
    mach_parsed_kwargs[arg_dest] = result[arg_dest]
    mach_parsed_kwargs["emulator"] = True
    runner = MarionetteTestRunner(**mach_parsed_kwargs)
    built_kwargs = runner._build_kwargs()
    assert built_kwargs[arg_dest] == expected_value