mirror of
https://github.com/ghndrx/shellmate.git
synced 2026-02-10 14:55:08 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user