feat: accept !start name without quotes, strip typographic quotes
This commit is contained in:
@@ -21,6 +21,21 @@ def test_start_with_single_word_name():
|
||||
assert result == ("start", "Bauer")
|
||||
|
||||
|
||||
def test_start_without_quotes():
|
||||
result = parse_trigger(msg(CURRENT_USER, "!start Stephan Rehfeld"), CURRENT_USER)
|
||||
assert result == ("start", "Stephan Rehfeld")
|
||||
|
||||
|
||||
def test_start_with_typographic_quotes():
|
||||
result = parse_trigger(msg(CURRENT_USER, "“start” is not this, but: !start “Anna Bauer”"), CURRENT_USER)
|
||||
assert result is None # not a trigger — just a regular message
|
||||
|
||||
|
||||
def test_start_with_smart_quotes_around_name():
|
||||
result = parse_trigger(msg(CURRENT_USER, '!start “Anna Bauer”'), CURRENT_USER)
|
||||
assert result == ("start", "Anna Bauer")
|
||||
|
||||
|
||||
def test_start_without_name_returns_placeholder():
|
||||
result = parse_trigger(msg(CURRENT_USER, "!start"), CURRENT_USER)
|
||||
assert result == ("start", "Unbekannter Vortragender")
|
||||
|
||||
Reference in New Issue
Block a user