Run mypy on zerver/tests/test_hooks.py.

This commit is contained in:
Tim Abbott 2016-06-15 15:27:49 -07:00
parent 6723525fd3
commit 5b05644c95
2 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,6 @@ zerver/tests/test_email_mirror.py
zerver/tests/test_decorators.py zerver/tests/test_decorators.py
zerver/tests/test_upload.py zerver/tests/test_upload.py
zerver/tests/test_messages.py zerver/tests/test_messages.py
zerver/tests/test_hooks.py
""".split() """.split()
parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.") parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.")

View File

@ -4,6 +4,7 @@ from zerver.lib.test_runner import slow
from zerver.models import Message, Recipient from zerver.models import Message, Recipient
import ujson import ujson
from six import text_type
from six.moves import urllib from six.moves import urllib
class WebhookTestCase(AuthedTestCase): class WebhookTestCase(AuthedTestCase):
@ -14,10 +15,10 @@ class WebhookTestCase(AuthedTestCase):
If you create your url in uncommon way you can override build_webhook_url method If you create your url in uncommon way you can override build_webhook_url method
In case that you need modify body or create it without using fixture you can also override get_body method In case that you need modify body or create it without using fixture you can also override get_body method
""" """
STREAM_NAME = None STREAM_NAME = None # type: text_type
TEST_USER_EMAIL = 'webhook-bot@zulip.com' TEST_USER_EMAIL = 'webhook-bot@zulip.com'
URL_TEMPLATE = None URL_TEMPLATE = None # type: text_type
FIXTURE_DIR_NAME = None FIXTURE_DIR_NAME = None # type: text_type
def setUp(self): def setUp(self):
self.url = self.build_webhook_url() self.url = self.build_webhook_url()
@ -241,7 +242,7 @@ class BeanstalkHookTests(WebhookTestCase):
return {'payload': self.fixture_data('beanstalk', fixture_name)} return {'payload': self.fixture_data('beanstalk', fixture_name)}
class GithubV1HookTests(WebhookTestCase): class GithubV1HookTests(WebhookTestCase):
STREAM_NAME = None STREAM_NAME = None # type: text_type
URL_TEMPLATE = "/api/v1/external/github" URL_TEMPLATE = "/api/v1/external/github"
FIXTURE_DIR_NAME = 'github' FIXTURE_DIR_NAME = 'github'
SEND_STREAM = False SEND_STREAM = False
@ -357,7 +358,7 @@ class GithubV1HookTests(WebhookTestCase):
"zbenjamin [commented](https://github.com/zbenjamin/zulip-test/commit/7c994678d2f98797d299abed852d3ff9d0834533#commitcomment-4252307) on `cowbell`, line 13\n\n~~~ quote\nThis line adds /unlucky/ cowbell (because of its line number). We should remove it.\n~~~") "zbenjamin [commented](https://github.com/zbenjamin/zulip-test/commit/7c994678d2f98797d299abed852d3ff9d0834533#commitcomment-4252307) on `cowbell`, line 13\n\n~~~ quote\nThis line adds /unlucky/ cowbell (because of its line number). We should remove it.\n~~~")
class GithubV2HookTests(WebhookTestCase): class GithubV2HookTests(WebhookTestCase):
STREAM_NAME = None STREAM_NAME = None # type: text_type
URL_TEMPLATE = "/api/v1/external/github" URL_TEMPLATE = "/api/v1/external/github"
FIXTURE_DIR_NAME = 'github' FIXTURE_DIR_NAME = 'github'
SEND_STREAM = False SEND_STREAM = False