def test_get_dlg_vars(self): test_drop = AbstractDROP( oid="a", uid="a", dlg_root="$DLG_ROOT", non_dlg_var="$DLG_NONEXISTS", non_var=set(), ) test_drop.autofill_environment_variables() self.assertEqual(getDlgDir(), test_drop.parameters["dlg_root"]) self.assertEqual(getDlgDir(), test_drop.get_environment_variable("$DLG_ROOT")) self.assertEqual("$DLG_NONEXISTS", test_drop.parameters["non_dlg_var"]) self.assertEqual("$DLG_NONEXISTS", test_drop.get_environment_variable("$DLG_NONEXISTS"))
def test_autofill_environment_vars(self): """ Tests the autofilling functionality of AbstractDROP """ env_drop = create_std_env_vars(name="env_vars") test_drop = AbstractDROP( oid="a", uid="a", dir_var="$env_vars.dir_var", int_var="$env_vars.int_var", non_var=set(), ) test_drop.addProducer(env_drop) test_drop.autofill_environment_variables() self.assertEqual("/HOME/", test_drop.parameters["dir_var"]) self.assertEqual(3, test_drop.parameters["int_var"])