Skip to content

Commit

Permalink
Update test_environment.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgen-lentz authored Nov 30, 2024
1 parent 98bf7ad commit 6b4e7ec
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions amplpy/tests/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ def test_environment_initialization(self):
self.assertEqual("binary_name_2", env.get_bin_name())

def test_environment(self):
from amplpy import Environment #, AMPL

#os.environ["PYTHONIOENCODING"] = "utf-8"
for name, value in os.environ.items():
print("{0}: {1}".format(name, value))
from amplpy import Environment, AMPL

os.environ["USER1"] = "Filipe Brandão".encode('utf-8')
os.environ["PYTHONIOENCODING"] = "utf-8"
os.environ["USER1"] = "Filipe Brandão"

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

def test_environment2(self):
from amplpy import Environment, AMPL

os.environ["USER1"] = "Filipe Brandão"
ampl = AMPL(Environment())
ampl.close()

Expand Down

0 comments on commit 6b4e7ec

Please sign in to comment.