test_.py 533 B

12345678910111213141516171819202122
  1. import shutil
  2. import subprocess
  3. import pytest
  4. import tooncher
  5. def test_start_engine():
  6. p = tooncher.start_engine(
  7. engine_path=shutil.which("printenv"),
  8. gameserver="gameserver",
  9. playcookie="cookie",
  10. stdout=subprocess.PIPE,
  11. stderr=subprocess.PIPE,
  12. )
  13. assert isinstance(p, subprocess.Popen)
  14. stdout, stderr = p.communicate()
  15. assert b"" == stderr
  16. env = stdout.strip().split(b"\n")
  17. assert b"TTR_GAMESERVER=gameserver" in env
  18. assert b"TTR_PLAYCOOKIE=cookie" in env