Skip to content

Conversation

@sandu-c
Copy link

@sandu-c sandu-c commented Jan 2, 2026

No description provided.

Copy link
Owner

@allenporter allenporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, these tests are very strong. One quick comment and I can get this merged and released for you.

timezone_compat.enable_extended_timezones(),
):
yield ics
elif prodid and _CALENDAR_LABS_PRODID in prodid:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK to enable this for all calendars given as you said it's a common problem. Can you apply in the outer scope and remove the "No compatibility mode needed" debug line?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@allenporter
Copy link
Owner

Thank you, these tests are very strong. One quick comment and I can get this merged and released for you.

There is a test failure

Copy link
Owner

@allenporter allenporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests don't pass and i have some requested changes below.


# Normalize DTSTAMP for calendar_labs files since it's auto-generated
if "calendar_labs" in filename.stem:
import re
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The style in this code base is that all imports are at the top of the file, not randomly in the code like AI likes to insert.

assert timezone_compat.is_allow_invalid_timezones_enabled()
assert timezone_compat.is_extended_timezones_enabled()
# Only check timezone compatibility for Exchange Server files
if "office_3" in filename.stem:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the text fixtures instead of doing this. That is, lets have different tests with different file globs for the test that apply. I don't want an accidental mistake related to the filename to mask this.

Copy link
Owner

@allenporter allenporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, one final small change.

if "calendar_labs" in filename.stem:
import re
new_ics = re.sub(r'DTSTAMP:\d{8}T\d{6}Z', 'DTSTAMP:20260103T212907Z', new_ics)
new_ics = re.sub(r'DTSTAMP:\d{8}T\d{6}Z', 'DTSTAMP:20260103T212907Z', new_ics)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a fixture like this to set the timestamp used for dtstamp:

@pytest.fixture(name="frozen_time", autouse=True)
def mock_frozen_time() -> Generator[FrozenDateTimeFactory, None, None]:
    """Fixture to freeze time to a specific point."""
    with freeze_time("2022-09-03T09:38:05") as freeze:
        with patch("ical.event.dtstamp_factory", new=freeze):
            yield freeze

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.

3 participants