mapillary_download/test_error_handling.py
2025-07-28 12:15:43 +02:00

29 lines
No EOL
674 B
Python

import json
import os
import sys
# Create a test JSON file with missing feed key
test_data = {
"data": {
"fetch__User": {
# "feed" key is missing
}
}
}
# Write test data to a temporary file
test_username = "test_user"
test_file = f"out_{test_username}.json"
with open(test_file, "w") as f:
json.dump(test_data, f)
print(f"Created test file: {test_file}")
print("Running get_sequences_of_username.py with test data...")
# Run the script with the test data
os.system(f"python3 get_sequences_of_username.py --username={test_username} --dev_token=test_token")
# Clean up
os.remove(test_file)
print(f"Removed test file: {test_file}")