Commit
Β·
09ce61a
1
Parent(s):
084af54
removed tempory test file
Browse files- test/test_fix.py +0 -55
test/test_fix.py
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
#!/usr/bin/env python3
|
2 |
-
"""
|
3 |
-
Quick test script to verify the fix for the None value error.
|
4 |
-
"""
|
5 |
-
|
6 |
-
import os
|
7 |
-
import sys
|
8 |
-
import tempfile
|
9 |
-
import shutil
|
10 |
-
|
11 |
-
# Add the parent directory to the path
|
12 |
-
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
13 |
-
|
14 |
-
from test import run_cli_redact
|
15 |
-
|
16 |
-
def test_none_handling():
|
17 |
-
"""Test that None values are handled properly."""
|
18 |
-
print("Testing None value handling...")
|
19 |
-
|
20 |
-
script_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "cli_redact.py")
|
21 |
-
output_dir = tempfile.mkdtemp(prefix="test_fix_")
|
22 |
-
|
23 |
-
try:
|
24 |
-
# Test with None input file (should handle gracefully for list action)
|
25 |
-
result = run_cli_redact(
|
26 |
-
script_path=script_path,
|
27 |
-
input_file=None, # No input file needed for list action
|
28 |
-
output_dir=output_dir,
|
29 |
-
task="textract",
|
30 |
-
textract_action="list"
|
31 |
-
)
|
32 |
-
|
33 |
-
print("β
None value handling test passed")
|
34 |
-
return True
|
35 |
-
|
36 |
-
except Exception as e:
|
37 |
-
print(f"β None value handling test failed: {e}")
|
38 |
-
return False
|
39 |
-
|
40 |
-
finally:
|
41 |
-
# Clean up
|
42 |
-
if os.path.exists(output_dir):
|
43 |
-
shutil.rmtree(output_dir)
|
44 |
-
|
45 |
-
if __name__ == "__main__":
|
46 |
-
print("Testing the fix for None value error...")
|
47 |
-
success = test_none_handling()
|
48 |
-
|
49 |
-
if success:
|
50 |
-
print("\nπ Fix appears to be working!")
|
51 |
-
print("You should now be able to run the full test suite without the None value error.")
|
52 |
-
else:
|
53 |
-
print("\nβ Fix needs more work.")
|
54 |
-
|
55 |
-
sys.exit(0 if success else 1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|