def setup_lp_cli(): """ Perform setup of LinchpinContext, lpc.load_config, and LinchPinAPI """ global lpctx global lpc global target global pinfile base_path = '{0}'.format(os.path.dirname( os.path.realpath(__file__))).rstrip('/') lib_path = os.path.realpath(os.path.join(base_path, os.pardir)) setup_load_config() pinfile = 'PinFile' mock_path = '{0}/{1}/{2}'.format(lib_path, 'mockdata', provider) lpctx = LinchpinCliContext() lpctx.load_config(lpconfig=config_path) lpctx.load_global_evars() lpctx.setup_logging() lpctx.workspace = os.path.realpath(mock_path) lpctx.pinfile = pinfile lpctx.pf_data = None lpctx.no_monitor = True lpctx.set_evar("no_monitor", True) lpctx.set_cfg("progress_bar", "no_progress", str(True)) lpc = LinchpinCli(lpctx) lpc.disable_pbar = True
def test_set_evar(): lpc = LinchpinCliContext() lpc.load_config(lpconfig=config_path) lpc.load_global_evars() lpc.set_evar('test', 'me') assert_equal('me', lpc.evars['test'])
def test_set_evar(): lpc = LinchpinCliContext() lpc.load_config(lpconfig=config_path) lpc.load_global_evars() lpc.set_evar('test', 'me') assert_equal('me', lpc.evars['test'])