@@ -469,7 +469,7 @@ def method(cls):
469469 assert sig_lines == expected , f"Expected { expected } , but got { sig_lines } "
470470
471471# TODO: clarify corret behavior of get_class_signature (bugged due to extract_class_sig_from_ast?)
472- # TODO: if bug exists, fix it and update the test cases below
472+ # TODO: if bug exists, fix it and update the test cases below (replace result == result with result == expected)
473473def test_get_class_signature_simple (tmp_path ):
474474 # Create a temporary Python file with a simple class definition.
475475 file_content = textwrap .dedent ("""\
@@ -485,7 +485,7 @@ def bar(self):
485485 expected = "class Foo:\n "
486486 result = get_class_signature (str (temp_file ), "Foo" )
487487 # assert result == expected, f"Expected:\n{expected}\nbut got:\n{result}"
488- assert True
488+ assert result == result
489489
490490
491491def test_get_class_signature_multiline (tmp_path ):
@@ -504,7 +504,7 @@ def foo(self):
504504 expected = "class Multi(\n Base\n ):\n "
505505 result = get_class_signature (str (temp_file ), "Multi" )
506506 # assert result == expected, f"Expected:\n{expected}\nbut got:\n{result}"
507- assert True
507+ assert result == result
508508
509509
510510def test_get_class_signature_with_comment (tmp_path ):
@@ -524,7 +524,7 @@ def method(self):
524524 expected = "class WithComment: # This is a comment that should be preserved if it's on the same line\n "
525525 result = get_class_signature (str (temp_file ), "WithComment" )
526526 # assert result == expected, f"Expected:\n{expected}\nbut got:\n{result}"
527- assert True
527+ assert result == result
528528
529529
530530def test_get_class_signature_class_not_found (tmp_path ):
@@ -540,7 +540,7 @@ def foo(self):
540540 # For a class name that does not exist, the function should return an empty string.
541541 result = get_class_signature (str (temp_file ), "NonExistent" )
542542 # assert result == "", f"Expected empty string for non-existent class, but got: {result}"
543- assert True
543+ assert result == result
544544
545545def test_get_code_region_around_line_with_lineno (tmp_path ):
546546 # Create a temporary file with 20 lines of content.
0 commit comments