-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from SkwalExe/tests
Add basic testing with PyTest
- Loading branch information
Showing
4 changed files
with
151 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import pytest | ||
|
||
# The project's venv must be activated, so that | ||
# Octologo is imported directly from src/octologo | ||
from octologo.__main__ import OctoLogoApp | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_no_errors() -> None: | ||
app = OctoLogoApp() | ||
async with app.run_test() as pilot: | ||
await pilot.pause() | ||
|
||
keypress_sequences = [ | ||
# Enter project name | ||
("M", "y", "P", "r", "o", "j", "e", "c", "t", "enter"), | ||
# select default style (just click next) | ||
("tab", "tab", "enter"), | ||
# select default font | ||
("tab", "enter"), | ||
# select default color scheme | ||
("tab", "tab", "enter"), | ||
# default value for the next 6 questions | ||
("enter",) * 6, | ||
] | ||
|
||
for keys in keypress_sequences: | ||
await pilot.press(*keys) | ||
await pilot.pause() | ||
|
||
# The test ends before the image gets generated |