Skip to content

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

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

dbarnett merged 2 commits into
mainfrom
fix/use-legacy-import

Conversation

@dbarnett

@dbarnett dbarnett commented Sep 23, 2025 •

Copy link
Copy Markdown
Collaborator

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

kody-ai Bot commented Oct 24, 2025 •

Copy link
Copy Markdown

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.

Comment thread tests/test_gcalcli.py Outdated
Comment thread tests/conftest.py
@kody-ai

kody-ai Bot commented Oct 24, 2025 •

Copy link
Copy Markdown

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
tpantsar pushed a commit to tpantsar/gcalcli that referenced this pull request Jul 4, 2026
tpantsar pushed a commit to tpantsar/gcalcli that referenced this pull request Jul 4, 2026
tpantsar pushed a commit to tpantsar/gcalcli that referenced this pull request Jul 4, 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