Skip to content

🧪 Add test for bad JSON token in fetch_sourcing_bom.py - #4

Open
aman-katyal wants to merge 1 commit into
masterfrom
test-fetch-sourcing-bom-bad-json-14391349534075253118
Open

🧪 Add test for bad JSON token in fetch_sourcing_bom.py#4
aman-katyal wants to merge 1 commit into
masterfrom
test-fetch-sourcing-bom-bad-json-14391349534075253118

Conversation

@aman-katyal

Copy link
Copy Markdown
Contributor

🎯 What: Added a missing error test for get_digikey_access_token in fetch_sourcing_bom.py. The original implementation had a try/except block for json.load() without any unit tests asserting its behavior.

📊 Coverage: The new test_get_digikey_access_token_bad_json test covers the scenario where the DigiKey token file (DIGIKEY_TOKEN_PATH) exists but contains invalid JSON data, ensuring that the script correctly catches the Exception, prints a warning to sys.stderr, and continues gracefully.

Result: Improved test coverage by explicitly validating the error handling logic, ensuring the script gracefully handles corrupt token files instead of crashing.


PR created automatically by Jules for task 14391349534075253118 started by @aman-katyal

Added a Pytest fixture for testing the exception block when a malformed
DigiKey token JSON file is encountered during the get_digikey_access_token
function execution.

Co-authored-by: aman-katyal <181611364+aman-katyal@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant