style: 代码格式化

This commit is contained in:
2025-12-13 21:47:37 +08:00
parent a0b327cdbb
commit baa7ac8ee9
64 changed files with 755 additions and 573 deletions

View File

@@ -1,6 +1,7 @@
"""
Test configuration and fixtures for HeurAMS tests.
"""
import pytest
import tempfile
import os
@@ -10,14 +11,16 @@ from pathlib import Path
@pytest.fixture
def temp_config_file():
"""Create a temporary config file for testing."""
with tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False) as f:
f.write('''{
with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f:
f.write(
"""{
"algorithm": "sm2",
"default_ease": 2.5,
"learning_steps": [1, 10],
"graduating_interval": 1,
"easy_interval": 4
}''')
}"""
)
temp_path = f.name
yield temp_path
@@ -31,21 +34,13 @@ def temp_config_file():
def sample_atom_data():
"""Sample atom data for testing."""
return {
"nucleon": {
"content": "What is the capital of France?",
"answer": "Paris"
},
"electron": {
"ease": 2.5,
"interval": 1,
"repetitions": 0,
"last_review": None
},
"nucleon": {"content": "What is the capital of France?", "answer": "Paris"},
"electron": {"ease": 2.5, "interval": 1, "repetitions": 0, "last_review": None},
"orbital": {
"learning_steps": [1, 10],
"graduating_interval": 1,
"easy_interval": 4
}
"easy_interval": 4,
},
}
@@ -60,4 +55,4 @@ This is a test document with some {{c1::cloze}} deletions.
Here's another {{c2::cloze deletion}} for testing.
What is the capital of {{c3::France}}?
"""
"""