| 1 |
from os import path |
| 2 |
|
| 3 |
extra_plugin_dir = path.join(path.dirname(path.realpath(__file__)), "dyna_plugin") |
| 4 |
|
| 5 |
|
| 6 |
def test_simple(testbot): |
| 7 |
assert "added" in testbot.exec_command("!add_simple") |
| 8 |
assert "yep" in testbot.exec_command("!say_yep") |
| 9 |
assert "foo" in testbot.exec_command("!say_foo") |
| 10 |
assert "documented" in testbot.exec_command("!help") |
| 11 |
assert "removed" in testbot.exec_command("!remove_simple") |
| 12 |
assert 'Command "say_foo" not found' in testbot.exec_command("!say_foo") |
| 13 |
|
| 14 |
|
| 15 |
def test_arg(testbot): |
| 16 |
assert "added" in testbot.exec_command("!add_arg") |
| 17 |
assert "string to echo is string_to_echo" in testbot.exec_command( |
| 18 |
"!echo_to_me string_to_echo" |
| 19 |
) |
| 20 |
assert "removed" in testbot.exec_command("!remove_arg") |
| 21 |
assert ( |
| 22 |
'Command "echo_to_me" / "echo_to_me string_to_echo" not found' |
| 23 |
in testbot.exec_command("!echo_to_me string_to_echo") |
| 24 |
) |
| 25 |
|
| 26 |
|
| 27 |
def test_re(testbot): |
| 28 |
assert "added" in testbot.exec_command("!add_re") |
| 29 |
assert "fffound" in testbot.exec_command("I said cheese") |
| 30 |
assert "removed" in testbot.exec_command("!remove_re") |
| 31 |
|
| 32 |
|
| 33 |
def test_saw(testbot): |
| 34 |
assert "added" in testbot.exec_command("!add_saw") |
| 35 |
assert "foo+bar+baz" in testbot.exec_command("!splitme foo,bar,baz") |
| 36 |
assert "removed" in testbot.exec_command("!remove_saw") |
| 37 |
|
| 38 |
|
| 39 |
def test_clashing(testbot): |
| 40 |
assert "original" in testbot.exec_command("!clash") |
| 41 |
assert ( |
| 42 |
"clashing.clash clashes with Dyna.clash so it has been renamed clashing-clash" |
| 43 |
in testbot.exec_command("!add_clashing") |
| 44 |
) |
| 45 |
assert "added" in testbot.pop_message() |
| 46 |
assert "original" in testbot.exec_command("!clash") |
| 47 |
assert "dynamic" in testbot.exec_command("!clashing-clash") |
| 48 |
assert "removed" in testbot.exec_command("!remove_clashing") |
| 49 |
assert "original" in testbot.exec_command("!clash") |
| 50 |
assert "not found" in testbot.exec_command("!clashing-clash") |