Skip to content

🧪 Tests for name2uniprot in pathwaycommons - #53

Closed
akutuva21 wants to merge 3 commits into
mainfrom
testing/pathwaycommons-name2uniprot-14141266211072448977
Closed

akutuva21 wants to merge 3 commits into
mainfrom
testing/pathwaycommons-name2uniprot-14141266211072448977

Conversation

@akutuva21

Copy link
Copy Markdown
Owner

🎯 What: The testing gap addressed
The name2uniprot function in bionetgen/atomizer/utils/pathwaycommons.py lacked test coverage and requires mocked HTTP calls to biogrid/uniprot to be tested safely. The correct signature is def name2uniprot(nameStr, organism) based on the active code in the repository.

📊 Coverage: What scenarios are now tested
Created tests mapping to five distinct scenarios using unittest.mock.patch for urllib.request.urlopen:

  1. Successful response when an organism is provided.
  2. Fallback response (no organism limitation query) when the organism query returns no results.
  3. Successful response when no organism is initially provided.
  4. Correct error handling (returning None) when an HTTPError occurs with an organism provided.
  5. Correct error handling when an HTTPError occurs without an organism provided.

✨ Result: The improvement in test coverage
Test coverage is significantly improved by isolating external network requests, leading to deterministic test execution for the name2uniprot function. We use byte-strings internally mapped with .decode('utf-8') for correctness since the responses come from urllib.request.urlopen().read().


PR created automatically by Jules for task 14141266211072448977 started by @akutuva21

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 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.

google-labs-jules Bot and others added 2 commits April 9, 2026 20:40
@akutuva21

Copy link
Copy Markdown
Owner Author

Superseded by #60 pathwaycommons HTTPError test coverage.

@akutuva21 akutuva21 closed this Apr 13, 2026
@google-labs-jules

Copy link
Copy Markdown

Superseded by #60 pathwaycommons HTTPError test coverage.

Understood. Acknowledging that this work is superseded by #60, and I will stop work on this task.

@akutuva21
akutuva21 deleted the testing/pathwaycommons-name2uniprot-14141266211072448977 branch April 13, 2026 14:46
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