Skip to content

Commit c37771e

Browse files
author
patched.codes[bot]
committed
Patched tests/steps/test_ExtractCode.py
1 parent 34b4fcb commit c37771e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/steps/test_ExtractCode.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ def test_extract_code_init(extract_code_instance):
5555

5656
def test_extract_code_run(extract_code_instance, tmp_path):
5757
# Run the extract code step
58+
"""Test the extract_code method of an ExtractCode instance.
59+
60+
This method runs the extract_code step and verifies the expected output structure and content.
61+
62+
Args:
63+
extract_code_instance (ExtractCode): An instance of the ExtractCode class to be tested.
64+
tmp_path (pathlib.Path): A temporary directory path provided by the pytest fixture.
65+
66+
Returns:
67+
None
68+
69+
Raises:
70+
AssertionError: If any of the assertions fail, indicating that the extract_code output
71+
does not match the expected structure or content.
72+
"""
5873
result = extract_code_instance.run()
5974

6075
assert result.keys() == {"files_to_patch"}
@@ -69,6 +84,18 @@ def test_extract_code_run(extract_code_instance, tmp_path):
6984

7085
@pytest.fixture
7186
def extract_code_instance_with_fix(tmp_path):
87+
"""Extract code instance with fix from a given test file.
88+
89+
Args:
90+
tmp_path (Path): A temporary directory path for creating and manipulating files.
91+
92+
Returns:
93+
Generator[ExtractCode]: A generator that yields an ExtractCode object containing
94+
the extracted code instance with fix information.
95+
96+
Raises:
97+
OSError: If there are issues with file operations or directory changes.
98+
"""
7299
original_dir = Path.cwd()
73100

74101
os.chdir(tmp_path)
@@ -109,6 +136,18 @@ def extract_code_instance_with_fix(tmp_path):
109136

110137
def test_extract_code_run_with_fix(extract_code_instance_with_fix, tmp_path):
111138
# Run the extract code step
139+
"""Test the extraction of code with fix functionality.
140+
141+
Args:
142+
extract_code_instance_with_fix (ExtractCode): An instance of ExtractCode class with fix functionality.
143+
tmp_path (pathlib.Path): A temporary directory path for the test.
144+
145+
Returns:
146+
None: This method doesn't return anything explicitly.
147+
148+
Raises:
149+
AssertionError: If any of the assertions fail during the test.
150+
"""
112151
result = extract_code_instance_with_fix.run()
113152

114153
assert result.keys() == {"files_to_patch"}

0 commit comments

Comments
 (0)