Skip to content

Improved blocklist parsing robustness and added comprehensive tests#1168

Merged
AttackingOrDefending merged 2 commits into
lichess-bot-devs:masterfrom
bayta-darell-1400:bayta/add-tests-for-blocklist
Dec 29, 2025
Merged

Improved blocklist parsing robustness and added comprehensive tests#1168
AttackingOrDefending merged 2 commits into
lichess-bot-devs:masterfrom
bayta-darell-1400:bayta/add-tests-for-blocklist

Conversation

@bayta-darell-1400

Copy link
Copy Markdown
Contributor

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

  • Added 15-second timeout to HTTP requests to prevent indefinite hanging
  • Used splitlines() to handle various line ending formats (CRLF, LF, CR)
  • Filtered empty usernames using walrus operator for better efficiency
  • Added test coverage for OnlineBlocklist.refresh() method
  • Added tests for error handling, ETag caching, and edge cases
  • Test Coverage of lib/blocklist.py is now 100%.

Related Issues:

ref #920

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

  • none

- Added 15-second timeout to HTTP requests to prevent indefinite hanging
- Used splitlines() to handle various line ending formats (CRLF, LF, CR)
- Filtered empty usernames using walrus operator for better efficiency
- Added test coverage for OnlineBlocklist.refresh() method
- Added tests for error handling, ETag caching, and edge cases
@AttackingOrDefending AttackingOrDefending merged commit fcaa276 into lichess-bot-devs:master Dec 29, 2025
23 checks passed
bayta-darell-1400 added a commit to bayta-darell-1400/lichess-bot that referenced this pull request Dec 30, 2025
…ichess-bot-devs#1168)

* Improved blocklist parsing robustness and added comprehensive tests

- Added 15-second timeout to HTTP requests to prevent indefinite hanging
- Used splitlines() to handle various line ending formats (CRLF, LF, CR)
- Filtered empty usernames using walrus operator for better efficiency
- Added test coverage for OnlineBlocklist.refresh() method
- Added tests for error handling, ETag caching, and edge cases

* lint fix
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