mirror of
https://github.com/283375/arcaea-offline.git
synced 2025-07-01 12:16:26 +00:00
fix!: ruff lint errors
* Refactor KanaeDayNight enum
This commit is contained in:
@ -21,7 +21,8 @@ class TestPlayResultCalculators:
|
||||
Decimal("-0.00")
|
||||
) == Decimal("-31.67")
|
||||
|
||||
pytest.raises(ValueError, PlayResultCalculators.score_modifier, -1)
|
||||
with pytest.raises(ValueError, match="negative"):
|
||||
PlayResultCalculators.score_modifier(-1)
|
||||
|
||||
pytest.raises(TypeError, PlayResultCalculators.score_modifier, "9800000")
|
||||
pytest.raises(TypeError, PlayResultCalculators.score_modifier, None)
|
||||
@ -38,5 +39,8 @@ class TestPlayResultCalculators:
|
||||
|
||||
pytest.raises(TypeError, PlayResultCalculators.play_rating, 10002221, None)
|
||||
|
||||
pytest.raises(ValueError, PlayResultCalculators.play_rating, -1, 120)
|
||||
pytest.raises(ValueError, PlayResultCalculators.play_rating, 10002221, -1)
|
||||
with pytest.raises(ValueError, match="negative"):
|
||||
PlayResultCalculators.play_rating(-1, 120)
|
||||
|
||||
with pytest.raises(ValueError, match="negative"):
|
||||
PlayResultCalculators.play_rating(10002221, -1)
|
||||
|
@ -14,7 +14,7 @@ def db_conn():
|
||||
conn.close()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
@pytest.fixture
|
||||
def db_session(db_conn):
|
||||
session = Session(bind=db_conn)
|
||||
yield session
|
||||
|
@ -21,7 +21,7 @@ def _difficulty(**kw):
|
||||
return Difficulty(**defaults)
|
||||
|
||||
|
||||
class Test_Chart:
|
||||
class TestChart:
|
||||
def init_db(self, session):
|
||||
SongsBase.metadata.create_all(session.bind, checkfirst=False)
|
||||
SongsViewBase.metadata.create_all(session.bind, checkfirst=False)
|
||||
|
@ -73,7 +73,9 @@ class TestPlayResultFormatter:
|
||||
assert PlayResultFormatter.score_grade(5500000) == "D"
|
||||
assert PlayResultFormatter.score_grade(0) == "D"
|
||||
|
||||
pytest.raises(ValueError, PlayResultFormatter.score_grade, -1)
|
||||
with pytest.raises(ValueError, match="negative"):
|
||||
PlayResultFormatter.score_grade(-1)
|
||||
|
||||
pytest.raises(TypeError, PlayResultFormatter.score_grade, "10001284")
|
||||
pytest.raises(TypeError, PlayResultFormatter.score_grade, [])
|
||||
pytest.raises(TypeError, PlayResultFormatter.score_grade, None)
|
||||
@ -108,7 +110,9 @@ class TestPlayResultFormatter:
|
||||
assert PlayResultFormatter.clear_type(1) == "NORMAL CLEAR"
|
||||
assert PlayResultFormatter.clear_type(6) == "UNKNOWN"
|
||||
|
||||
pytest.raises(ValueError, PlayResultFormatter.clear_type, -1)
|
||||
with pytest.raises(ValueError, match="negative"):
|
||||
PlayResultFormatter.clear_type(-1)
|
||||
|
||||
pytest.raises(TypeError, PlayResultFormatter.clear_type, "1")
|
||||
pytest.raises(TypeError, PlayResultFormatter.clear_type, [])
|
||||
|
||||
@ -121,6 +125,8 @@ class TestPlayResultFormatter:
|
||||
assert PlayResultFormatter.modifier(1) == "EASY"
|
||||
assert PlayResultFormatter.modifier(6) == "UNKNOWN"
|
||||
|
||||
pytest.raises(ValueError, PlayResultFormatter.modifier, -1)
|
||||
with pytest.raises(ValueError, match="negative"):
|
||||
PlayResultFormatter.modifier(-1)
|
||||
|
||||
pytest.raises(TypeError, PlayResultFormatter.modifier, "1")
|
||||
pytest.raises(TypeError, PlayResultFormatter.modifier, [])
|
||||
|
Reference in New Issue
Block a user