def test_decide_overwrite_var_dynamic_path_logdir(): """options provided in cli get preference over the ones provided inside tests """ logdir = result_dir namespace = Namespace(datafile=None, random_tc_execution=False,\ wrapperfile=None, resultdir=None, logdir=logdir, outputdir=None, jobid=None,\ pythonpath=None, genericdatafile=None, gen_no_of_samples=None, gen_select_rows=None,\ gen_shuffle_columns=None, gen_purge_db=None, gen_exec_tag=None, gen_report=None) result = warrior_cli_driver.decide_overwrite_var(namespace) assert result['ow_logdir'] == logdir
def test_decide_overwrite_var_dynamic_path_datafile(): """options provided in cli get preference over the ones provided inside tests """ temp_dir1 = os.path.join(os.getcwd(), "war_test1.xml") namespace = Namespace(datafile='war_test1.xml', random_tc_execution=False, wrapperfile=None,\ resultdir=None, logdir=None, outputdir=None, jobid=None, pythonpath=None,\ genericdatafile=None, gen_no_of_samples=None, gen_select_rows=None,\ gen_shuffle_columns=None, gen_purge_db=None, gen_exec_tag=None, gen_report=None) result = warrior_cli_driver.decide_overwrite_var(namespace) assert result['ow_datafile'] == temp_dir1
def test_decide_overwrite_var_random_tc_execution_true(): """options provided in cli get preference over the ones provided inside tests """ temp_dir = os.path.join(os.path.split(__file__)[0], "war_test3.xml") namespace = Namespace(datafile=None, random_tc_execution=True,\ wrapperfile=None, resultdir=None, logdir=None, outputdir=None, jobid=None,\ pythonpath=None, genericdatafile=None, gen_select_rows=None,\ gen_no_of_samples=None, gen_shuffle_columns=None, gen_purge_db=None,\ gen_exec_tag=None, gen_report=None) result = warrior_cli_driver.decide_overwrite_var(namespace) assert result['random_tc_execution'] == True
def test_decide_overwrite_var_gen(): """options provided in cli get preference over the ones provided inside tests """ outputdir = result_dir namespace = Namespace(datafile=None, random_tc_execution=False,\ wrapperfile=None, resultdir=None, logdir=None, outputdir=None, jobid=None,\ pythonpath=None, genericdatafile=True, gen_no_of_samples=True,\ gen_shuffle_columns=True, gen_select_rows=True, gen_purge_db=True,\ gen_exec_tag=True, gen_report=True) result = warrior_cli_driver.decide_overwrite_var(namespace) test1 = 'genericdatafile' in result test2 = 'gen_no_of_samples' in result test3 = 'gen_shuffle_columns' in result assert test1 == True assert test2 == True assert test3 == True