treasurechest/run_tests.py

20 lines
521 B
Python
Raw Normal View History

2020-05-08 13:38:08 +00:00
#!/usr/bin/env python3
from subprocess import Popen, PIPE
DOTNET_EXE = "dotnet"
EXE = "run"
with Popen([DOTNET_EXE, EXE, "-version"], stdout=PIPE) as proc:
data = proc.stdout.read().decode()
assert data.count(".") == 2
assert data.startswith("TreasureChest")
with Popen([DOTNET_EXE, EXE], stdout=PIPE) as proc:
data = proc.stdout.read().decode()
assert data.count(".") == 2
assert data.startswith("TreasureChest")
assert "Run with help for more options" in data
print("All tests passed")