Skip to content

Commit 1fd15ee

Browse files
committed
WIP: fixup
1 parent 5258395 commit 1fd15ee

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

tests/test_cli.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def test_set_no_file(cli):
189189

190190

191191
def test_get_default_path(tmp_path):
192-
(tmp_path / ".env").write_text("A=B")
192+
(tmp_path / ".env").write_text("A=x")
193193

194194
result = subprocess.run(
195195
["dotenv", "get", "A"],
@@ -199,11 +199,11 @@ def test_get_default_path(tmp_path):
199199
text=True,
200200
)
201201

202-
assert result.stdout == "B\n"
202+
assert result.stdout == "x\n"
203203

204204

205205
def test_run(tmp_path):
206-
(tmp_path / ".env").write_text("A=B")
206+
(tmp_path / ".env").write_text("A=x")
207207

208208
result = subprocess.run(
209209
["dotenv", "run", "printenv", "A"],
@@ -213,13 +213,13 @@ def test_run(tmp_path):
213213
text=True,
214214
)
215215

216-
assert result.stdout == "B\n"
216+
assert result.stdout == "x\n"
217217

218218

219219
def test_run_with_existing_variable(tmp_path):
220-
(tmp_path / ".env").write_text("A=B")
220+
(tmp_path / ".env").write_text("A=x")
221221
env = dict(os.environ)
222-
env.update({"LANG": "en_US.UTF-8", "A": "C"})
222+
env.update({"LANG": "en_US.UTF-8", "A": "y"})
223223

224224
result = subprocess.run(
225225
["dotenv", "run", "printenv", "A"],
@@ -230,11 +230,11 @@ def test_run_with_existing_variable(tmp_path):
230230
env=env,
231231
)
232232

233-
assert result.stdout == "B\n"
233+
assert result.stdout == "x\n"
234234

235235

236236
def test_run_with_existing_variable_not_overridden(tmp_path):
237-
(tmp_path / ".env").write_text("A=B")
237+
(tmp_path / ".env").write_text("A=x")
238238
env = dict(os.environ)
239239
env.update({"LANG": "en_US.UTF-8", "A": "C"})
240240

@@ -251,7 +251,7 @@ def test_run_with_existing_variable_not_overridden(tmp_path):
251251

252252

253253
def test_run_with_none_value(tmp_path):
254-
(tmp_path / ".env").write_text("A=B\nc")
254+
(tmp_path / ".env").write_text("A=x\nc")
255255

256256
result = subprocess.run(
257257
["dotenv", "run", "printenv", "A"],
@@ -261,11 +261,11 @@ def test_run_with_none_value(tmp_path):
261261
text=True,
262262
)
263263

264-
assert result.stdout == "B\n"
264+
assert result.stdout == "x\n"
265265

266266

267267
def test_run_with_other_env(dotenv_path):
268-
dotenv_path.write_text("A=B")
268+
dotenv_path.write_text("A=x")
269269

270270
result = subprocess.run(
271271
["dotenv", "--file", dotenv_path, "run", "printenv", "A"],
@@ -274,7 +274,7 @@ def test_run_with_other_env(dotenv_path):
274274
text=True,
275275
)
276276

277-
assert result.stdout == "B\n"
277+
assert result.stdout == "x\n"
278278

279279

280280
def test_run_without_cmd(cli):

tests/test_zip_imports.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import posixpath
23
import subprocess
34
import sys
@@ -77,7 +78,7 @@ def test_load_dotenv_outside_zip_file_when_called_in_zipfile(tmp_path):
7778
],
7879
)
7980
dotenv_path = tmp_path / ".env"
80-
dotenv_path.write_bytes(b"A=B")
81+
dotenv_path.write_bytes(b"A=x")
8182
code_path = tmp_path / "code.py"
8283
code_path.write_text(
8384
textwrap.dedent(
@@ -100,6 +101,7 @@ def test_load_dotenv_outside_zip_file_when_called_in_zipfile(tmp_path):
100101
check=True,
101102
cwd=tmp_path,
102103
text=True,
104+
env = {k: v for k, v in os.environ.items() if k.upper() != 'A'}, # env without 'A'
103105
)
104106

105-
assert result.stdout == "B\n"
107+
assert result.stdout == "x\n"

0 commit comments

Comments
 (0)