bot lib tests: Move tests of bot library to tests/.
This makes it clearer which files are for writing bot tests vs tests of the infrastructure.
This commit is contained in:
parent
9e6b4edee6
commit
4c8d86c1d9
|
@ -28,7 +28,7 @@ exclude = [
|
||||||
# Excluded out of laziness:
|
# Excluded out of laziness:
|
||||||
"zulip_bots/zulip_bots/terminal.py",
|
"zulip_bots/zulip_bots/terminal.py",
|
||||||
"zulip_bots/zulip_bots/simple_lib.py",
|
"zulip_bots/zulip_bots/simple_lib.py",
|
||||||
"zulip_bots/zulip_bots/lib_tests.py",
|
"zulip_bots/zulip_bots/tests/test_lib.py",
|
||||||
"tools",
|
"tools",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,8 @@ def run_all():
|
||||||
cov.load()
|
cov.load()
|
||||||
cov.start()
|
cov.start()
|
||||||
|
|
||||||
module = import_module('zulip_bots.lib_tests')
|
module = 'zulip_bots/zulip_bots/tests/'
|
||||||
suite = unittest.defaultTestLoader.loadTestsFromModule(module)
|
suite = unittest.defaultTestLoader.discover(module)
|
||||||
|
|
||||||
suite = unittest.TestSuite([suite])
|
suite = unittest.TestSuite([suite])
|
||||||
runner = unittest.TextTestRunner(verbosity=2)
|
runner = unittest.TextTestRunner(verbosity=2)
|
||||||
|
|
|
@ -14,7 +14,7 @@ from unittest.mock import patch
|
||||||
class TestDefaultArguments(TestCase):
|
class TestDefaultArguments(TestCase):
|
||||||
|
|
||||||
our_dir = os.path.dirname(__file__)
|
our_dir = os.path.dirname(__file__)
|
||||||
path_to_bot = os.path.abspath(os.path.join(our_dir, 'bots/giphy/giphy.py'))
|
path_to_bot = os.path.abspath(os.path.join(our_dir, '../bots/giphy/giphy.py'))
|
||||||
|
|
||||||
@patch('sys.argv', ['zulip-run-bot', 'giphy', '--config-file', '/foo/bar/baz.conf'])
|
@patch('sys.argv', ['zulip-run-bot', 'giphy', '--config-file', '/foo/bar/baz.conf'])
|
||||||
@patch('zulip_bots.run.run_message_handler_for_bot')
|
@patch('zulip_bots.run.run_message_handler_for_bot')
|
Loading…
Reference in a new issue