style: 代码格式化
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Working unit tests for algorithm modules based on actual module structure.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
from src.heurams.kernel.algorithms.sm2 import SM2Algorithm
|
||||
@@ -29,12 +30,7 @@ class TestSM2Algorithm:
|
||||
|
||||
def test_sm2_is_due(self):
|
||||
"""Test SM2Algorithm is_due method."""
|
||||
algodata = {
|
||||
"SM-2": {
|
||||
"next_date": 0, # Past date
|
||||
"is_activated": 1
|
||||
}
|
||||
}
|
||||
algodata = {"SM-2": {"next_date": 0, "is_activated": 1}} # Past date
|
||||
|
||||
result = SM2Algorithm.is_due(algodata)
|
||||
|
||||
@@ -42,13 +38,7 @@ class TestSM2Algorithm:
|
||||
|
||||
def test_sm2_rate(self):
|
||||
"""Test SM2Algorithm rate method."""
|
||||
algodata = {
|
||||
"SM-2": {
|
||||
"efactor": 2.5,
|
||||
"rept": 5,
|
||||
"interval": 10
|
||||
}
|
||||
}
|
||||
algodata = {"SM-2": {"efactor": 2.5, "rept": 5, "interval": 10}}
|
||||
|
||||
result = SM2Algorithm.rate(algodata)
|
||||
|
||||
@@ -56,11 +46,7 @@ class TestSM2Algorithm:
|
||||
|
||||
def test_sm2_nextdate(self):
|
||||
"""Test SM2Algorithm nextdate method."""
|
||||
algodata = {
|
||||
"SM-2": {
|
||||
"next_date": 100
|
||||
}
|
||||
}
|
||||
algodata = {"SM-2": {"next_date": 100}}
|
||||
|
||||
result = SM2Algorithm.nextdate(algodata)
|
||||
|
||||
@@ -75,7 +61,7 @@ class TestSM2Algorithm:
|
||||
"real_rept": 0,
|
||||
"interval": 1,
|
||||
"is_activated": 1,
|
||||
"last_modify": 0
|
||||
"last_modify": 0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,4 +71,4 @@ class TestSM2Algorithm:
|
||||
# Verify that algodata was modified
|
||||
assert "efactor" in algodata["SM-2"]
|
||||
assert "rept" in algodata["SM-2"]
|
||||
assert "interval" in algodata["SM-2"]
|
||||
assert "interval" in algodata["SM-2"]
|
||||
|
||||
Reference in New Issue
Block a user