2019-09-28 20:32:02 +00:00
|
|
|
import pytest
|
|
|
|
import flyingsnake
|
|
|
|
from click.testing import CliRunner
|
|
|
|
|
|
|
|
|
|
|
|
# Main integration test
|
|
|
|
def test_full_render():
|
|
|
|
runner = CliRunner()
|
2019-09-28 22:58:42 +00:00
|
|
|
result = runner.invoke(flyingsnake.flyingsnake, ["./tests/Small_Example.wld", "./tests/Small_Example_full.png"])
|
2019-10-01 13:44:44 +00:00
|
|
|
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
|