Fix all ruff linting errors

- Fix import ordering (isort)
- Remove unused imports
- Fix line too long (>100 chars)
- Fix variable naming (PIECES -> piece_chars)
- Fix bare except clause
- Remove unused variable
This commit is contained in:
Greg Hendrickson
2026-01-27 20:54:19 +00:00
parent ff643e1265
commit 8a5e1785dc
13 changed files with 111 additions and 94 deletions

View File

@@ -1,9 +1,9 @@
"""Tests for SSH server functionality."""
import asyncio
import pytest
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
class TestShellMateSSHServer:
"""Test SSH server authentication."""
@@ -113,9 +113,10 @@ class TestChessBoard:
def test_board_initialization(self):
"""Board should initialize with standard position."""
from shellmate.tui.widgets.board import ChessBoardWidget
import chess
from shellmate.tui.widgets.board import ChessBoardWidget
widget = ChessBoardWidget()
assert widget.board.fen() == chess.STARTING_FEN
@@ -136,9 +137,10 @@ class TestChessBoard:
def test_square_selection(self):
"""Selecting a square should show legal moves."""
from shellmate.tui.widgets.board import ChessBoardWidget
import chess
from shellmate.tui.widgets.board import ChessBoardWidget
widget = ChessBoardWidget()
# Select e2 pawn
@@ -152,9 +154,10 @@ class TestChessBoard:
def test_square_deselection(self):
"""Deselecting should clear legal moves."""
from shellmate.tui.widgets.board import ChessBoardWidget
import chess
from shellmate.tui.widgets.board import ChessBoardWidget
widget = ChessBoardWidget()
widget.select_square(chess.E2)
widget.select_square(None)
@@ -251,9 +254,10 @@ class TestIntegration:
@pytest.mark.asyncio
async def test_server_starts(self):
"""Server should start without errors."""
from shellmate.ssh.server import start_server
import tempfile
import os
import tempfile
from shellmate.ssh.server import start_server
# Create a temporary host key
with tempfile.TemporaryDirectory() as tmpdir: