mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
Annotate zerver.lib.testing_mocks.
Also fix some annotations in bugdown to match.
This commit is contained in:
@@ -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")
|
@cache_with_key(lambda tweet_id: tweet_id, cache_name="database", with_statsd_key="tweet_data")
|
||||||
def fetch_tweet_data(tweet_id):
|
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:
|
if settings.TEST_SUITE:
|
||||||
from . import testing_mocks
|
from . import testing_mocks
|
||||||
res = testing_mocks.twitter(tweet_id)
|
res = testing_mocks.twitter(tweet_id)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from typing import Any, Dict, Optional
|
||||||
import ujson
|
import ujson
|
||||||
|
|
||||||
|
|
||||||
@@ -236,6 +237,7 @@ MEDIA_TWEET = """{
|
|||||||
|
|
||||||
|
|
||||||
def twitter(tweet_id):
|
def twitter(tweet_id):
|
||||||
|
# type: (str) -> Optional[Dict[str, Any]]
|
||||||
if tweet_id in ["112652479837110273", "287977969287315456", "287977969287315457"]:
|
if tweet_id in ["112652479837110273", "287977969287315456", "287977969287315457"]:
|
||||||
return ujson.loads(NORMAL_TWEET)
|
return ujson.loads(NORMAL_TWEET)
|
||||||
elif tweet_id == "287977969287315458":
|
elif tweet_id == "287977969287315458":
|
||||||
|
|||||||
Reference in New Issue
Block a user