Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgen-lentz committed Dec 3, 2024
1 parent cd27967 commit d25fd30
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion amplpy/environment.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ cdef class Environment(object):
def to_string(self):
cdef const char* to_string_c
campl.AMPL_EnvironmentToString(self._c_env, &to_string_c)
to_string = str(to_string_c.decode('utf-16'))
to_string = str(to_string_c.decode('utf-8'))
return to_string

def set_bin_dir(self, binary_directory):
Expand Down
6 changes: 6 additions & 0 deletions amplpy/tests/test_ampl.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
class TestAMPL(TestBase.TestBase):
"""Test AMPL."""

def test_ampldebug(self):
ampl = self.ampl
ampl.eval("param name symbolic := 'brandão';")
print(ampl.get_value("name"))
self.assertEqual(ampl.get_value("name"), 'brandão')

def test_ampl(self):
from amplpy import Set, Parameter, Variable, Constraint, Objective

Expand Down
6 changes: 3 additions & 3 deletions amplpy/tests/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_environment(self):
from amplpy import Environment, AMPL

#os.environ["PYTHONIOENCODING"] = "utf-8"
os.environ["USER1"] = "Filipe Brandão"
#os.environ["USER1"] = "Filipe Brandão"

env1 = Environment()
env2 = Environment(os.curdir)
Expand All @@ -39,8 +39,8 @@ def test_environment(self):
self.assertEqual(env2["MyEnvVar"], None)
d = dict(env1)
self.assertEqual(d["MyEnvVar"], "TEST")
#ampl = AMPL(Environment())
#ampl.close()
ampl = AMPL(Environment())
ampl.close()

def test_env_options(self):
from amplpy import AMPL, Environment
Expand Down

0 comments on commit d25fd30

Please sign in to comment.