@@ -81,6 +81,43 @@ def test_update_qsl_compat_qpk_pin_rewrites_only_qpk_requirement(self) -> None:
8181 self .assertIn (f"QuantPlatformKit.git@{ TARGET } " , updated )
8282 self .assertIn (f"UsEquityStrategies.git@{ STALE } " , updated )
8383
84+ def test_update_qsl_compat_qpk_pin_rewrites_qsl_requires_map (self ) -> None :
85+ with tempfile .TemporaryDirectory () as tmp :
86+ qsl_path = Path (tmp ) / "qsl.toml"
87+ qsl_path .write_text (
88+ "[qsl.requires]\n "
89+ f'quant_platform_kit = "{ STALE } "\n '
90+ f'quant-platform-kit = "{ STALE } "\n '
91+ f'crypto_strategies = "{ STALE } "\n '
92+ "\n [runtime]\n "
93+ f'quant_platform_kit = "{ STALE } "\n ' ,
94+ encoding = "utf-8" ,
95+ )
96+
97+ self .assertTrue (update_qsl_compat_qpk_pin (Path (tmp ), TARGET ))
98+ updated = qsl_path .read_text (encoding = "utf-8" )
99+
100+ self .assertIn (f'quant_platform_kit = "{ TARGET } "' , updated )
101+ self .assertIn (f'quant-platform-kit = "{ TARGET } "' , updated )
102+ self .assertIn (f'crypto_strategies = "{ STALE } "' , updated )
103+ self .assertIn (f'[runtime]\n quant_platform_kit = "{ STALE } "' , updated )
104+
105+ def test_update_qsl_compat_qpk_pin_rewrites_single_quoted_qsl_requires_map (self ) -> None :
106+ with tempfile .TemporaryDirectory () as tmp :
107+ qsl_path = Path (tmp ) / "qsl.toml"
108+ qsl_path .write_text (
109+ "[qsl.requires]\n "
110+ f"quant_platform_kit = '{ STALE } '\n "
111+ f"'quant-platform-kit' = '{ STALE } '\n " ,
112+ encoding = "utf-8" ,
113+ )
114+
115+ self .assertTrue (update_qsl_compat_qpk_pin (Path (tmp ), TARGET ))
116+ updated = qsl_path .read_text (encoding = "utf-8" )
117+
118+ self .assertIn (f"quant_platform_kit = '{ TARGET } '" , updated )
119+ self .assertIn (f"'quant-platform-kit' = '{ TARGET } '" , updated )
120+
84121
85122if __name__ == "__main__" :
86123 unittest .main ()
0 commit comments