@@ -94,7 +94,7 @@ def test_import_extraction(self, code_snippet, expected_imports):
9494
9595class TestCodeAnalyzerAttributes :
9696 @pytest .mark .parametrize (
97- "code_snippet, expected_structure " ,
97+ "code_snippet, expected_analyzed_classes " ,
9898 [
9999 pytest .param (
100100 """
@@ -242,19 +242,21 @@ def __init__(self):
242242 ),
243243 ],
244244 )
245- def test_attribute_extraction (self , code_snippet : str , expected_structure : list ):
245+ def test_attribute_extraction (
246+ self , code_snippet : str , expected_analyzed_classes : list
247+ ):
246248 """Tests the extraction of class and instance attributes."""
247249 analyzer = CodeAnalyzer ()
248250 tree = ast .parse (code_snippet )
249251 analyzer .visit (tree )
250252
251- extracted = analyzer .structure
253+ extracted = analyzer .analyzed_classes
252254 # Normalize attributes for order-independent comparison
253255 for item in extracted :
254256 if "attributes" in item :
255257 item ["attributes" ].sort (key = lambda x : x ["name" ])
256- for item in expected_structure :
258+ for item in expected_analyzed_classes :
257259 if "attributes" in item :
258260 item ["attributes" ].sort (key = lambda x : x ["name" ])
259261
260- assert extracted == expected_structure
262+ assert extracted == expected_analyzed_classes
0 commit comments