Skip to content

test: add edge case coverage for Conference parameter normalization#1310

Merged
niccokunzmann merged 2 commits intocollective:mainfrom
tmchow:test-conference-normalize-edge-cases
Apr 6, 2026
Merged

test: add edge case coverage for Conference parameter normalization#1310
niccokunzmann merged 2 commits intocollective:mainfrom
tmchow:test-conference-normalize-edge-cases

Conversation

@tmchow
Copy link
Copy Markdown
Contributor

@tmchow tmchow commented Apr 6, 2026

Summary

Adds 12 tests covering edge cases in the normalize() function used by Conference.to_uri() for the feature, label, and language parameters.

Why this matters

PR #921 fixed the normalization bug from #908, but left edge cases untested. The normalize() function in conference.py:88-93 handles three input types (string, empty list, None) and any of these branches could regress during refactoring without test coverage.

Changes

src/icalendar/tests/prop/test_conference.py: Added 12 new tests in three groups:

  • Focused tests (test_string_feature_passthrough, test_empty_list_feature_filtered, test_none_feature_omitted): Verify core behavior with feature parameter
  • Parametrized string passthrough (test_string_passthrough_all_params): Verifies string values pass through unchanged for all three parameters
  • Parametrized empty list filtering (test_empty_list_filtered_all_params): Verifies empty lists are omitted for all three parameters
  • Parametrized None omission (test_none_omitted_all_params): Verifies None values produce no param entry for all three parameters

Testing

All 36 tests pass (24 existing + 12 new):

============================== 36 passed in 0.22s ==============================

Fixes #925

This contribution was developed with AI assistance (Claude Code).

Add tests for the normalize() function's handling of string passthrough,
empty list filtering, and None omission across feature, label, and
language parameters. These edge cases were identified in collective#925 after the
normalization fix in PR collective#921.

Closes collective#925
@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community bot commented Apr 6, 2026

Documentation build overview

📚 icalendar | 🛠️ Build #32132031 | 📁 Comparing e57bc2d against latest (f4aaa99)

  🔍 Preview build  

Show files changed (2 files in total): 📝 2 modified | ➕ 0 added | ➖ 0 deleted
File Status
404.html 📝 modified
reference/changelog.html 📝 modified

Fix ruff PT006 (parametrize first arg should be a tuple) and add
the missing CHANGES.rst entry for the Conference test coverage.
@tmchow tmchow requested a review from stevepiercy as a code owner April 6, 2026 10:28
Copy link
Copy Markdown
Member

@niccokunzmann niccokunzmann left a comment

Choose a reason for hiding this comment

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

Thanks! The tests seem alright.

@niccokunzmann niccokunzmann enabled auto-merge April 6, 2026 11:32
@niccokunzmann niccokunzmann merged commit 0889142 into collective:main Apr 6, 2026
30 checks passed
@tmchow
Copy link
Copy Markdown
Contributor Author

tmchow commented Apr 6, 2026

Thanks! The tests seem alright.

Thanks for the approval and merge!

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.

Add test coverage for Conference parameter edge cases

2 participants