Skip to content

test: cover admin functionality of Trigger#2735

Open
SnoopJ wants to merge 1 commit intosopel-irc:masterfrom
SnoopJ:test/test-admins-functionality
Open

test: cover admin functionality of Trigger#2735
SnoopJ wants to merge 1 commit intosopel-irc:masterfrom
SnoopJ:test/test-admins-functionality

Conversation

@SnoopJ
Copy link
Copy Markdown
Contributor

@SnoopJ SnoopJ commented Apr 12, 2026

Description

Closes #2734 by adding a new test that checks that Trigger.admin is correct for a basic PRIVMSG. Could be expanded for other types of messages but I figured this was a good start.

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make lint and make test)
  • I have tested the functionality of the things this change touches

@SnoopJ SnoopJ requested a review from a team April 12, 2026 23:28
@SnoopJ SnoopJ added the Tests label Apr 12, 2026
@dgw
Copy link
Copy Markdown
Member

dgw commented Apr 14, 2026

This is getting at what I meant here about "discretizing" different cases.

Parametrized tests make each combination a unique test that can pass or fail independently, which I (at least) find helpful when something regresses. That's great :)

I would just ask you to consider adding nick-only matching to this matrix for completeness. Possibly also wildcard handling, since that's a feature of the underlying pattern generator:

def get_hostmask_regex(mask):
"""Get a compiled regex pattern for an IRC hostmask
:param str mask: the hostmask that the pattern should match
:return: a compiled regex pattern matching the given ``mask``
:rtype: :ref:`re.Pattern <python:re-objects>`
.. versionadded:: 4.4
"""
mask = re.escape(mask)
mask = mask.replace(r'\*', '.*')
return re.compile(mask + '$', re.I)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core.admins functionality is not tested

2 participants