forked from nf-core/tools
-
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.
- Loading branch information
Showing
5 changed files
with
483 additions
and
1 deletion.
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
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ textual-dev>=1.2.1 | |
mypy | ||
types-PyYAML | ||
types-requests | ||
pytest-textual-snapshot |
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
""" Test Pipeline Create App """ | ||
import pytest | ||
|
||
from nf_core.pipelines.create import PipelineCreateApp | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_app_bindings(): | ||
"""Test that the app bindings work.""" | ||
app = PipelineCreateApp() | ||
async with app.run_test() as pilot: | ||
# Test pressing the D key | ||
assert app.dark == True | ||
await pilot.press("d") | ||
assert app.dark == False | ||
await pilot.press("d") | ||
assert app.dark == True | ||
|
||
# Test pressing the Q key | ||
await pilot.press("q") | ||
assert app.return_code == 0 | ||
|
||
|
||
def test_welcome(snap_compare): | ||
"""Test snapshot for the first screen in the app. The welcome screen.""" | ||
assert snap_compare("../nf_core/pipelines/create/__init__.py") | ||
|
||
|
||
def test_choose_type(snap_compare): | ||
"""Test snapshot for the choose_type screen. | ||
screen welcome > press start > screen choose_type | ||
""" | ||
|
||
async def run_before(pilot) -> None: | ||
await pilot.click("#start") | ||
|
||
assert snap_compare("../nf_core/pipelines/create/__init__.py", terminal_size=(100, 50), run_before=run_before) |