Ejemplo n.º 1
0
    def test_write_shortcut(self):
        read_configuration(self._get_config_path("config1.ini"))

        tmp = self._get_tmp_file()
        fname = tmp.name

        write_configuration(fname)

        new_env = Environment()
        read_configuration(fname, new_env)
        os.remove(fname)

        env = get_env()
        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())
Ejemplo n.º 2
0
    def test_write_shortcut(self):
        read_configuration(self._get_config_path("config1.ini"))

        tmp = self._get_tmp_file()
        fname = tmp.name

        write_configuration(fname)

        new_env = Environment()
        read_configuration(fname, new_env)
        try:
            os.remove(fname)
        except WindowsError:
            print("Error deleting file...")

        env = get_env()
        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())
Ejemplo n.º 3
0
 def test_read_shortcut(self):
     read_configuration(self._get_config_path("config1.ini"))
     env = get_env()
     self.assertTrue("mathsat-smt" in env.factory.all_solvers())
     self.assertTrue("z3-smt" in env.factory.all_solvers())
Ejemplo n.º 4
0
 def test_bad_conf(self):
     with self.assertRaises(Exception):
         read_configuration(self._get_config_path("config_bad.ini"))
Ejemplo n.º 5
0
 def test_nonexistent_conf(self):
     with self.assertRaises(PysmtIOError):
         read_configuration("/tmp/nonexistent")
Ejemplo n.º 6
0
 def test_nonexistent_conf(self):
     with self.assertRaises(IOError):
         read_configuration("/tmp/nonexistent")
Ejemplo n.º 7
0
 def test_read_shortcut(self):
     read_configuration(self._get_config_path("config1.ini"))
     env = get_env()
     self.assertTrue("mathsat-smt" in env.factory.all_solvers())
     self.assertTrue("z3-smt" in env.factory.all_solvers())
Ejemplo n.º 8
0
 def test_bad_conf(self):
     with self.assertRaises(Exception):
         read_configuration(self._get_config_path("config_bad.ini"))