Browse Source

fixed test_start_engine_mac

Fabian Peter Hammerle 4 years ago
parent
commit
9f5f3a6e9f
2 changed files with 6 additions and 0 deletions
  1. 3 0
      CHANGELOG.md
  2. 3 0
      tests/test_api.py

+ 3 - 0
CHANGELOG.md

@@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Added
 - package: use readme as long description for pypi.org
 
+### Fixed
+- `test_start_engine_mac` if `os.environ != {}`
+
 ## [1.0.0] - 2019-12-23
 ### Added
 - path to tootown engine may be provided via env var `$TOONCHER_ENGINE_PATH`

+ 3 - 0
tests/test_api.py

@@ -22,6 +22,7 @@ def test_start_engine():
     assert b"TTR_PLAYCOOKIE=cookie" in env
 
 
+@unittest.mock.patch("os.environ", {"SOME": "VAR", "OTHER": "VALUE"})
 def test_start_engine_mac():
     app_support_path = "/Users/me/Library/Application Support"
     with unittest.mock.patch("subprocess.Popen") as popen_mock:
@@ -43,6 +44,8 @@ def test_start_engine_mac():
             "/Users/me/Library/Application Support/Toontown Rewritten"
         ),
         env={
+            "SOME": "VAR",
+            "OTHER": "VALUE",
             "TTR_GAMESERVER": "gameserver",
             "TTR_PLAYCOOKIE": "cookie",
             "DYLD_LIBRARY_PATH": app_support_path