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())
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())
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())
def test_bad_conf(self): with self.assertRaises(Exception): read_configuration(self._get_config_path("config_bad.ini"))
def test_nonexistent_conf(self): with self.assertRaises(PysmtIOError): read_configuration("/tmp/nonexistent")
def test_nonexistent_conf(self): with self.assertRaises(IOError): read_configuration("/tmp/nonexistent")