mirror of
https://github.com/Steffo99/flyingsnake.git
synced 2024-12-22 06:34:18 +00:00
Add partial render test
This commit is contained in:
parent
40a0ec32b1
commit
393f2dfe5e
1 changed files with 13 additions and 2 deletions
|
@ -1,11 +1,22 @@
|
||||||
import pytest
|
import pytest
|
||||||
import flyingsnake
|
import flyingsnake
|
||||||
from click.testing import CliRunner
|
from click.testing import CliRunner
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
|
|
||||||
# Main integration test
|
# Main integration test
|
||||||
def test_full_render():
|
def test_full_render():
|
||||||
runner = CliRunner()
|
runner = CliRunner()
|
||||||
result = runner.invoke(flyingsnake.flyingsnake, ["./tests/Small_Example.wld", "./tests/Small_Example_full.png"])
|
result = runner.invoke(flyingsnake.flyingsnake, ["./tests/Small_Example.wld", "./tests/Small_Example_full.png"])
|
||||||
assert Image.open("./tests/Small_Example_full.png") == Image.open("./tests/Small_Example_full_prerendered.png")
|
assert result.exit_code == 0
|
||||||
|
# TODO: compare image with a valid one
|
||||||
|
|
||||||
|
|
||||||
|
def test_partial_render():
|
||||||
|
runner = CliRunner()
|
||||||
|
result = runner.invoke(flyingsnake.flyingsnake, ["./tests/Small_Example.wld", "./tests/Small_Example_part.png",
|
||||||
|
"-x", "500", "-y", "500", "-w", "123", "-h", "321"])
|
||||||
|
assert result.exit_code == 0
|
||||||
|
# TODO: compare image with a valid one
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: test the various options
|
||||||
|
|
Loading…
Reference in a new issue