Example #1
0
def test_wait_for_device_missing_passwd(mock_exit, cli_args, device):
    new_args = deepcopy(cli_args)
    new_args.env_passwd = None
    with pytest.raises(SystemExit):
        eos_bootstrap.EosBootstrap(args['server'], new_args)
    mock_exit.assert_called_with(
        results={'ok': False,
                 'error_type': 'login',
                 'message': 'login user-password missing'}
    )
Example #2
0
def test_wait_for_device_missing_username(mock_exit, cli_args, device):
    new_args = deepcopy(cli_args)
    new_args.user = None
    new_args.env_user = None
    local_eb = eos_bootstrap.EosBootstrap(args['server'], new_args)
    with pytest.raises(SystemExit):
        local_eb.wait_for_device(1, 2)
    mock_exit.assert_called_with(
        target=device.target,
        results={'ok': False,
                 'error_type': 'login',
                 'message': 'login user-name missing'}
    )
Example #3
0
def eb_obj(cli_args):
    os.environ['ENV_PASS'] = '******'
    eb = eos_bootstrap.EosBootstrap(args['server'], cli_args)
    return eb