Unify key support/resistance monitor type and fix form parity.
Merge 关键阻力位/关键支撑位 into 关键支撑阻力, share key_monitor_form.js across hub and new-tab views, and add hub shortcut to /key_monitor. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import unittest
|
||||
|
||||
from key_monitor_lib import (
|
||||
KEY_MONITOR_RS_TYPE,
|
||||
is_rs_key_monitor_type,
|
||||
rs_monitor_type_for_storage,
|
||||
rs_monitor_type_label,
|
||||
)
|
||||
|
||||
|
||||
class KeyMonitorRsTypeTests(unittest.TestCase):
|
||||
def test_legacy_types_still_recognized(self):
|
||||
self.assertTrue(is_rs_key_monitor_type("关键阻力位"))
|
||||
self.assertTrue(is_rs_key_monitor_type("关键支撑位"))
|
||||
|
||||
def test_storage_normalizes_to_unified_type(self):
|
||||
self.assertEqual(rs_monitor_type_for_storage("关键阻力位"), KEY_MONITOR_RS_TYPE)
|
||||
self.assertEqual(rs_monitor_type_for_storage("关键支撑位"), KEY_MONITOR_RS_TYPE)
|
||||
self.assertEqual(rs_monitor_type_for_storage(KEY_MONITOR_RS_TYPE), KEY_MONITOR_RS_TYPE)
|
||||
|
||||
def test_label_merges_legacy_display(self):
|
||||
self.assertEqual(rs_monitor_type_label("关键阻力位"), KEY_MONITOR_RS_TYPE)
|
||||
self.assertEqual(rs_monitor_type_label("箱体突破"), "箱体突破")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user