Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #144 (no comm. on 1st class Sunday) #150

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

DLakomy
Copy link
Contributor

@DLakomy DLakomy commented Jul 1, 2023

No description provided.

Copy link
Owner

@mmolenda mmolenda 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 for the PR. Just add the test please.

# The feast of the Immaculate Conception of the Blessed Virgin Mary, however,
# is preferred to the Sunday of Advent on which it may occur. (General Rubrics, 15)
if date_ == date(date_.year, 12, 8) and date_.weekday() == SUNDAY:
return [match(observances, PATTERN_SANCTI)], [match(observances, PATTERN_TEMPORA)], []
Copy link
Owner

Choose a reason for hiding this comment

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

Can you add a test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are already some tests covering the cases like the Sunday on December 8, Sunday on another day, December 8 not on Sunday.

test_given_date_contains_proper_day_ids:

((1907, 12, 8), [c.TEMPORA_ADV2_0], [c.SANCTI_12_08], [c.TEMPORA_ADV2_0]),
((1912, 12, 8), [c.TEMPORA_ADV2_0], [c.SANCTI_12_08], [c.TEMPORA_ADV2_0]),
((1913, 12, 8), [c.TEMPORA_ADV2_1], [c.SANCTI_12_08], []),

test_conflicts:

((2019, 12, 8), [c.SANCTI_12_08], [c.TEMPORA_ADV2_0]),
((2019, 9, 8), [c.TEMPORA_PENT13_0], [c.SANCTI_09_08]),

(the second one is a Sunday not on December 8, which proves that the new code didn't force a commemoration of the Sunday)

test_calculated_commemorations:

# In Conceptione Immaculata Beatæ Mariæ Virginis, commemoration of the Sunday
((2019, 12, 8), …

Is something missing? By the way this is how I discovered the problem after fixing the original issue. These tests were failing.

Copy link
Owner

Choose a reason for hiding this comment

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

Fair enough. Thank you!

@mmolenda mmolenda merged commit b2b01d9 into mmolenda:master Jul 7, 2023
1 check passed
This was referenced Jul 7, 2023
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.

2 participants