Add comprehensive unit tests (79 tests, 0% → 97% coverage)#2
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Add comprehensive unit tests (79 tests, 0% → 97% coverage)#2devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
… 97% coverage) - gmail-mcp: tests for mime.py, gmail.py, auth.py, server.py (42 tests) - outlook-mcp: tests for graph.py, auth.py, server.py (37 tests) - Add pytest.ini with importlib mode for multi-package test discovery - All external APIs mocked (httpx, google-auth, msal) — no network needed Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The repo had zero unit tests — only a Docker-dependent smoke-test script (
scripts/test_outlook_mcp.py). This PR adds a proper pytest suite covering all source modules in both packages, bringing coverage from 0% to 97%.What's added:
tests/test_mime.pybuild_raw()— base64url encoding, RFC 2822 headers, threading headers, unicodetests/test_gmail.pycall()HTTP wrapper — auth header injection, error handling, empty responsestests/test_auth.pyget_token()— cached valid token, refresh flow, missing credentials error, first-use interactive flowtests/test_server.pytests/test_graph.pycall()HTTP wrapper — same coverage as gmailtests/test_auth.pyget_token()— silent token, device-code flow, failure paths, cache persistencetests/test_server.pyAll external APIs (httpx, google-auth, msal) are fully mocked — tests run offline in <1s.
Configuration:
pytest.iniat repo root with--import-mode=importlibto handle same-named test files across the two packages.The only uncovered lines (3%) are the
main()entrypoints that callserver.run()with transport selection.Link to Devin session: https://app.devin.ai/sessions/32968d7c1f31457baa312260778937f0
Requested by: @fafaisland