Skip to content

Commit

Permalink
Added a unit test for a reported bug on numbers not matching .* (errb…
Browse files Browse the repository at this point in the history
  • Loading branch information
gbin authored and zoni committed May 27, 2017
1 parent cb0d0b9 commit 84f76e7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/matchall_plugin/matchall.plug
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[Core]
Name = MatchAll
Module = matchall

7 changes: 7 additions & 0 deletions tests/matchall_plugin/matchall.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from errbot import BotPlugin, botmatch


class MatchAll(BotPlugin):
@botmatch(r".*")
def all(self, msg, match):
return 'Works!'
14 changes: 14 additions & 0 deletions tests/matchall_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# coding=utf-8
from os import path

import pytest

extra_plugin_dir = path.join(path.dirname(path.realpath(__file__)), 'matchall_plugin')


def test_botmatch_correct(testbot):
assert 'Works!' in testbot.exec_command('hi hi hi')


def test_botmatch(testbot):
assert 'Works!' in testbot.exec_command('123123')

0 comments on commit 84f76e7

Please sign in to comment.