@@ -25,6 +25,34 @@ def test_atexit_closes_threadpool(self):
2525 atexit ._run_exitfuncs ()
2626 self .assertIsNone (client ._pool )
2727
28+ def test_deserialize_dict_syntax_compatibility (self ):
29+ """Test ApiClient.__deserialize supports both
30+ dict(str, str) and dict[str, str] syntax"""
31+ client = kubernetes .client .ApiClient ()
32+
33+ # Test data
34+ test_data = {
35+ 'key1' : 'value1' ,
36+ 'key2' : 'value2'
37+ }
38+
39+ # Test legacy syntax: dict(str, str)
40+ # legacy syntax is no longer supported after upgrading openapi generator to v6.6.0
41+ #result_legacy = client._ApiClient__deserialize(test_data, 'dict(str, str)')
42+ #self.assertEqual(result_legacy, test_data)
43+
44+ # Test modern syntax: dict[str, str]
45+ result_modern = client ._ApiClient__deserialize (test_data , 'dict[str, str]' )
46+ self .assertEqual (result_modern , test_data )
47+
48+ # Test nested dict: dict[str, dict[str, str]]
49+ nested_data = {
50+ 'outer1' : {'inner1' : 'value1' , 'inner2' : 'value2' },
51+ 'outer2' : {'inner3' : 'value3' }
52+ }
53+ result_nested = client ._ApiClient__deserialize (nested_data , 'dict[str, dict[str, str]]' )
54+ self .assertEqual (result_nested , nested_data )
55+
2856 def test_rest_proxycare (self ):
2957
3058 pool = { 'proxy' : urllib3 .ProxyManager , 'direct' : urllib3 .PoolManager }
0 commit comments