1
Fork 0
mirror of https://github.com/Steffo99/flyingsnake.git synced 2024-12-22 06:34:18 +00:00

Add integration test

This commit is contained in:
Steffo 2019-09-28 22:32:02 +02:00
parent 4f58c11524
commit ee62cfea9e
6 changed files with 20 additions and 1 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
*.wld filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored
View file

@ -5,5 +5,4 @@ settings.xml
dist/ dist/
**/__pycache__/ **/__pycache__/
setup/ setup/
sample_world/
build/ build/

View file

@ -1,3 +1,4 @@
click>=7.0 click>=7.0
lihzahrd>=1.0b1 lihzahrd>=1.0b1
Pillow>=6.1.0 Pillow>=6.1.0
pytest>=5.1.3

BIN
tests/Small_Example_full.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
tests/Small_Example_full_prerendered.png (Stored with Git LFS) Normal file

Binary file not shown.

11
tests/test_flyingsnake.py Normal file
View file

@ -0,0 +1,11 @@
import pytest
import flyingsnake
from click.testing import CliRunner
from PIL import Image
# Main integration test
def test_full_render():
runner = CliRunner()
result = runner.invoke(flyingsnake.flyingsnake, ["./Small_Example.wld", "./Small_Example_full.png"])
assert Image.open("./Small_Example_full.png") == Image.open("./Small_Example_full_prerendered.png")