-
Bruce Cowan authoredBruce Cowan authored
test_karma.py 1.43 KiB
# Copyright © 2018 Bruce Cowan <bruce@bcowan.eu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
pytest_plugins = ["errbot.backends.test"]
extra_plugin_dir = '.'
def test_empty(testbot):
testbot.assertCommand("!karma list", "Warning: Nothing in the karma database")
def test_adddec(testbot):
testbot.assertCommand("!karma add test", "Karma for 'test' is now 1")
testbot.assertCommand("!karma test", "Karma for 'test' is 1")
testbot.assertCommand("!karma remove test", "Karma for 'test' is now 0")
testbot.assertCommand("!karma test", "Karma for 'test' is 0")
def test_regex(testbot):
testbot.assertCommand("test++", "Karma for 'test' is now 1")
testbot.assertCommand("!karma test", "Karma for 'test' is 1")
testbot.assertCommand("test--", "Karma for 'test' is now 0")
testbot.assertCommand("!karma test", "Karma for 'test' is 0")