def read_configuration(config_filename, environment=None): """ Reads the pysmt configuration of the given file path and applies it on the specified environment. If no environment is specified, the top-level environment will be used. """ if environment is None: environment = get_env() config.configure_environment(config_filename, environment)
def test_write(self): env = get_env() configure_environment(self._get_config_path("config1.ini"), env) tmp = self._get_tmp_file() fname = tmp.name write_environment_configuration(fname, env) new_env = Environment() configure_environment(fname, new_env) os.remove(fname) self.assertEqual(new_env.enable_infix_notation, env.enable_infix_notation) self.assertEqual(new_env.factory.solver_preference_list, env.factory.solver_preference_list) self.assertTrue("mathsat-smt" in new_env.factory.all_solvers()) self.assertTrue("z3-smt" in new_env.factory.all_solvers())
def test_write(self): env = get_env() configure_environment(self._get_config_path("config1.ini"), env) tmp = self._get_tmp_file() fname = tmp.name write_environment_configuration(fname, env) new_env = Environment() configure_environment(fname, new_env) try: os.remove(fname) except WindowsError: print("Error deleting file...") self.assertEqual(new_env.enable_infix_notation, env.enable_infix_notation) self.assertEqual(new_env.factory.solver_preference_list, env.factory.solver_preference_list) self.assertTrue("mathsat-smt" in new_env.factory.all_solvers()) self.assertTrue("z3-smt" in new_env.factory.all_solvers())
def test_read(self): env = get_env() configure_environment(self._get_config_path("config1.ini"), env) self.assertTrue("mathsat-smt" in env.factory.all_solvers()) self.assertTrue("z3-smt" in env.factory.all_solvers())