Skip to content

Commit

Permalink
fairly ok coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Jun 10, 2024
1 parent 2acd23f commit b8655eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions sksmithy/tui/_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def compose(self: Self) -> ComposeResult:
Footer(),
)

def action_toggle_dark(self: Self) -> None:
def action_toggle_dark(self: Self) -> None: # pragma: no cover
"""Toggle dark mode."""
self.dark = not self.dark

def action_toggle_sidebar(self: Self) -> None:
def action_toggle_sidebar(self: Self) -> None: # pragma: no cover
"""Toggle sidebar component."""
sidebar = self.query_one(Sidebar)
self.set_focus(None)
Expand Down
13 changes: 7 additions & 6 deletions tests/test_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ async def test_forge_raise() -> None:
assert "The following parameters are invalid python identifiers: ('b b',)" in m3


async def test_forge(tmp_path: Path) -> None:
@pytest.mark.parametrize("use_binding", [True, False])
async def test_forge(tmp_path: Path, use_binding: bool) -> None:
"""Test forge button and all of its interactions."""
app = ForgeTUI()
name = "MightyEstimator"
Expand All @@ -164,14 +165,14 @@ async def test_forge(tmp_path: Path) -> None:
await output_file_comp.action_submit()
await pilot.pause()

forge_btn = pilot.app.query_one("#forge-btn", Button)
forge_btn.action_press()
if use_binding:
await pilot.press("F")
else:
forge_btn = pilot.app.query_one("#forge-btn", Button)
forge_btn.action_press()
await pilot.pause()

notification = next(iter(pilot.app._notifications)) # noqa: SLF001

assert f"Template forged at {output_file!s}" in notification.message
assert output_file.exists()


def test_bindings() -> None: ...

0 comments on commit b8655eb

Please sign in to comment.