Esempio n. 1
0
def write_configuration(config_filename, environment=None):
    """
    Dumps the current pysmt configuration to the specified file path
    """
    if environment is None:
        environment = get_env()
    config.write_environment_configuration(config_filename, environment)
Esempio n. 2
0
def write_configuration(config_filename, environment=None):
    """
    Dumps the current pysmt configuration to the specified file path
    """
    if environment is None:
        environment = get_env()
    config.write_environment_configuration(config_filename, environment)
Esempio n. 3
0
def write_configuration(config_filename, environment=None):
    """Dumps the current pysmt configuration to the specified file path

    :param config_filename: Specify the name of the config file
    :param environment: Specify the environment
    """
    if environment is None:
        environment = get_env()
    config.write_environment_configuration(config_filename, environment)
Esempio n. 4
0
def write_configuration(config_filename, environment=None):
    """Dumps the current pysmt configuration to the specified file path

    :param config_filename: Specify the name of the config file
    :param environment: Specify the environment
    """
    if environment is None:
        environment = get_env()
    config.write_environment_configuration(config_filename, environment)
Esempio n. 5
0
    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())
Esempio n. 6
0
    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())