Annotate zerver.lib.testing_mocks.

Also fix some annotations in bugdown to match.
This commit is contained in:
Tim Abbott 2016-06-04 22:54:49 -07:00
parent 157a3efb78
commit 1ca7c3378b
2 changed files with 3 additions and 1 deletions

View File

@ -110,7 +110,7 @@ def add_a(root, url, link, height="", title=None, desc=None,
@cache_with_key(lambda tweet_id: tweet_id, cache_name="database", with_statsd_key="tweet_data")
def fetch_tweet_data(tweet_id):
# type: (text_type) -> Optional[Dict[text_type, text_type]]
# type: (str) -> Optional[Dict[str, Any]]
if settings.TEST_SUITE:
from . import testing_mocks
res = testing_mocks.twitter(tweet_id)

View File

@ -1,5 +1,6 @@
from __future__ import absolute_import
from typing import Any, Dict, Optional
import ujson
@ -236,6 +237,7 @@ MEDIA_TWEET = """{
def twitter(tweet_id):
# type: (str) -> Optional[Dict[str, Any]]
if tweet_id in ["112652479837110273", "287977969287315456", "287977969287315457"]:
return ujson.loads(NORMAL_TWEET)
elif tweet_id == "287977969287315458":