Skip to content

Fix backwards logic on --use-legacy-import and add tests#845

Merged
dbarnett merged 2 commits intomainfrom
fix/use-legacy-import
Oct 25, 2025
Merged

Fix backwards logic on --use-legacy-import and add tests#845
dbarnett merged 2 commits intomainfrom
fix/use-legacy-import

Conversation

@dbarnett
Copy link
Copy Markdown
Collaborator

@dbarnett dbarnett commented Sep 23, 2025

Fixes #836 (or at least improves it).


This pull request enhances the testing infrastructure for gcalcli to more accurately simulate Google Calendar API interactions, particularly for the ImportICS functionality.

Key changes include:

  • Improved Google API Client Mocking: The test utilities (tests/_utils.py and tests/conftest.py) have been updated to faithfully mimic the Google API client's two-step call pattern. This involves methods (like list(), insert(), import_()) returning a request object, which then requires an execute() call to perform the actual API operation. This ensures that tests precisely track which Google API method is invoked.
  • Enhanced ImportICS Test Accuracy: This improved mocking allows for more accurate verification of gcalcli's ImportICS method, ensuring it correctly dispatches to either the Google Calendar events().import_ or events().insert API based on event properties and the --use-legacy-import flag.
  • Test Variable Renaming: In tests/test_gcalcli.py, the ics_content variable was renamed to ics_file in relevant ImportICS tests for improved clarity.

These changes provide a more robust testing environment to verify the correct logic for using the import versus insert API, especially in the context of the --use-legacy-import flag.

@dbarnett
Copy link
Copy Markdown
Collaborator Author

@kody start-review

@kody-ai
Copy link
Copy Markdown

kody-ai bot commented Oct 24, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration

@reviewOptions

Access your configuration settings here.

@kody-ai
Copy link
Copy Markdown

kody-ai bot commented Oct 24, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration

@reviewOptions

Access your configuration settings here.

@dbarnett dbarnett force-pushed the fix/use-legacy-import branch from c76924e to a2df36c Compare October 24, 2025 13:44
@dbarnett dbarnett merged commit 405639c into main Oct 25, 2025
10 checks passed
@dbarnett dbarnett deleted the fix/use-legacy-import branch October 25, 2025 01:39
kda pushed a commit to kda/gcalcli that referenced this pull request Jan 7, 2026
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.

importing .ical file sends extraneous email to other attendees

1 participant