We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Tests missing for `User.mention_markdown` and `User.mention_html`
And while we're at it. Maybe `helpers.mention_markdown/html` too.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `telegram/utils/helpers.py`
Content:
```
1 #!/usr/bin/env python
2 #
3 # A library that provides a Python interface to the Telegram Bot API
4 # Copyright (C) 2015-2018
5 # Leandro Toledo de Souza <devs@python-telegram-bot.org>
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU Lesser Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser Public License
18 # along with this program.  If not, see [http://www.gnu.org/licenses/].
19 """This module contains helper functions."""
20 from html import escape
21 
22 import re
23 import signal
24 from datetime import datetime
25 
26 # From https://stackoverflow.com/questions/2549939/get-signal-names-from-numbers-in-python
27 _signames = {v: k
28              for k, v in reversed(sorted(vars(signal).items()))
29              if k.startswith('SIG') and not k.startswith('SIG_')}
30 
31 
32 def get_signal_name(signum):
33     """Returns the signal name of the given signal number."""
34     return _signames[signum]
35 
36 
37 # Not using future.backports.datetime here as datetime value might be an input from the user,
38 # making every isinstace() call more delicate. So we just use our own compat layer.
39 if hasattr(datetime, 'timestamp'):
40     # Python 3.3+
41     def _timestamp(dt_obj):
42         return dt_obj.timestamp()
43 else:
44     # Python < 3.3 (incl 2.7)
45     from time import mktime
46 
47     def _timestamp(dt_obj):
48         return mktime(dt_obj.timetuple())
49 
50 
51 def escape_markdown(text):
52     """Helper function to escape telegram markup symbols."""
53     escape_chars = '\*_`\['
54     return re.sub(r'([%s])' % escape_chars, r'\\\1', text)
55 
56 
57 def to_timestamp(dt_obj):
58     """
59     Args:
60         dt_obj (:class:`datetime.datetime`):
61 
62     Returns:
63         int:
64 
65     """
66     if not dt_obj:
67         return None
68 
69     return int(_timestamp(dt_obj))
70 
71 
72 def from_timestamp(unixtime):
73     """
74     Args:
75         unixtime (int):
76 
77     Returns:
78         datetime.datetime:
79 
80     """
81     if not unixtime:
82         return None
83 
84     return datetime.fromtimestamp(unixtime)
85 
86 
87 def mention_html(user_id, name):
88     """
89     Args:
90         user_id (:obj:`int`) The user's id which you want to mention.
91         name (:obj:`str`) The name the mention is showing.
92 
93     Returns:
94         :obj:`str`: The inline mention for the user as html.
95     """
96     if isinstance(user_id, int):
97         return '<a href="tg://user?id={}">{}</a>'.format(user_id, escape(name))
98 
99 
100 def mention_markdown(user_id, name):
101     """
102     Args:
103         user_id (:obj:`int`) The user's id which you want to mention.
104         name (:obj:`str`) The name the mention is showing.
105 
106     Returns:
107         :obj:`str`: The inline mention for the user as markdown.
108     """
109     if isinstance(user_id, int):
110         return '[{}](tg://user?id={})'.format(escape_markdown(name), user_id)
111 
112 
113 def effective_message_type(entity):
114     """
115     Extracts the type of message as a string identifier from a :class:`telegram.Message` or a
116     :class:`telegram.Update`.
117 
118     Args:
119         entity (:obj:`Update` | :obj:`Message`) The ``update`` or ``message`` to extract from
120 
121     Returns:
122         str: One of ``Message.MESSAGE_TYPES``
123 
124     """
125 
126     # Importing on file-level yields cyclic Import Errors
127     from telegram import Message
128     from telegram import Update
129 
130     if isinstance(entity, Message):
131         message = entity
132     elif isinstance(entity, Update):
133         message = entity.effective_message
134     else:
135         raise TypeError("entity is not Message or Update (got: {})".format(type(entity)))
136 
137     for i in Message.MESSAGE_TYPES:
138         if getattr(message, i, None):
139             return i
140 
141     return None
142
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/telegram/utils/helpers.py b/telegram/utils/helpers.py
--- a/telegram/utils/helpers.py
+++ b/telegram/utils/helpers.py
@@ -94,7 +94,7 @@
         :obj:`str`: The inline mention for the user as html.
     """
     if isinstance(user_id, int):
-        return '<a href="tg://user?id={}">{}</a>'.format(user_id, escape(name))
+        return u'<a href="tg://user?id={}">{}</a>'.format(user_id, escape(name))
 
 
 def mention_markdown(user_id, name):
@@ -107,7 +107,7 @@
         :obj:`str`: The inline mention for the user as markdown.
     """
     if isinstance(user_id, int):
-        return '[{}](tg://user?id={})'.format(escape_markdown(name), user_id)
+        return u'[{}](tg://user?id={})'.format(escape_markdown(name), user_id)
 
 
 def effective_message_type(entity):

{"golden_diff": "diff --git a/telegram/utils/helpers.py b/telegram/utils/helpers.py\n--- a/telegram/utils/helpers.py\n+++ b/telegram/utils/helpers.py\n@@ -94,7 +94,7 @@\n         :obj:`str`: The inline mention for the user as html.\n     \"\"\"\n     if isinstance(user_id, int):\n-        return '<a href=\"tg://user?id={}\">{}</a>'.format(user_id, escape(name))\n+        return u'<a href=\"tg://user?id={}\">{}</a>'.format(user_id, escape(name))\n \n \n def mention_markdown(user_id, name):\n@@ -107,7 +107,7 @@\n         :obj:`str`: The inline mention for the user as markdown.\n     \"\"\"\n     if isinstance(user_id, int):\n-        return '[{}](tg://user?id={})'.format(escape_markdown(name), user_id)\n+        return u'[{}](tg://user?id={})'.format(escape_markdown(name), user_id)\n \n \n def effective_message_type(entity):\n", "issue": "Tests missing for `User.mention_markdown` and `User.mention_html`\nAnd while we're at it. Maybe `helpers.mention_markdown/html` too.\r\n\n", "before_files": [{"content": "#!/usr/bin/env python\n#\n# A library that provides a Python interface to the Telegram Bot API\n# Copyright (C) 2015-2018\n# Leandro Toledo de Souza <devs@python-telegram-bot.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Lesser Public License for more details.\n#\n# You should have received a copy of the GNU Lesser Public License\n# along with this program.  If not, see [http://www.gnu.org/licenses/].\n\"\"\"This module contains helper functions.\"\"\"\nfrom html import escape\n\nimport re\nimport signal\nfrom datetime import datetime\n\n# From https://stackoverflow.com/questions/2549939/get-signal-names-from-numbers-in-python\n_signames = {v: k\n             for k, v in reversed(sorted(vars(signal).items()))\n             if k.startswith('SIG') and not k.startswith('SIG_')}\n\n\ndef get_signal_name(signum):\n    \"\"\"Returns the signal name of the given signal number.\"\"\"\n    return _signames[signum]\n\n\n# Not using future.backports.datetime here as datetime value might be an input from the user,\n# making every isinstace() call more delicate. So we just use our own compat layer.\nif hasattr(datetime, 'timestamp'):\n    # Python 3.3+\n    def _timestamp(dt_obj):\n        return dt_obj.timestamp()\nelse:\n    # Python < 3.3 (incl 2.7)\n    from time import mktime\n\n    def _timestamp(dt_obj):\n        return mktime(dt_obj.timetuple())\n\n\ndef escape_markdown(text):\n    \"\"\"Helper function to escape telegram markup symbols.\"\"\"\n    escape_chars = '\\*_`\\['\n    return re.sub(r'([%s])' % escape_chars, r'\\\\\\1', text)\n\n\ndef to_timestamp(dt_obj):\n    \"\"\"\n    Args:\n        dt_obj (:class:`datetime.datetime`):\n\n    Returns:\n        int:\n\n    \"\"\"\n    if not dt_obj:\n        return None\n\n    return int(_timestamp(dt_obj))\n\n\ndef from_timestamp(unixtime):\n    \"\"\"\n    Args:\n        unixtime (int):\n\n    Returns:\n        datetime.datetime:\n\n    \"\"\"\n    if not unixtime:\n        return None\n\n    return datetime.fromtimestamp(unixtime)\n\n\ndef mention_html(user_id, name):\n    \"\"\"\n    Args:\n        user_id (:obj:`int`) The user's id which you want to mention.\n        name (:obj:`str`) The name the mention is showing.\n\n    Returns:\n        :obj:`str`: The inline mention for the user as html.\n    \"\"\"\n    if isinstance(user_id, int):\n        return '<a href=\"tg://user?id={}\">{}</a>'.format(user_id, escape(name))\n\n\ndef mention_markdown(user_id, name):\n    \"\"\"\n    Args:\n        user_id (:obj:`int`) The user's id which you want to mention.\n        name (:obj:`str`) The name the mention is showing.\n\n    Returns:\n        :obj:`str`: The inline mention for the user as markdown.\n    \"\"\"\n    if isinstance(user_id, int):\n        return '[{}](tg://user?id={})'.format(escape_markdown(name), user_id)\n\n\ndef effective_message_type(entity):\n    \"\"\"\n    Extracts the type of message as a string identifier from a :class:`telegram.Message` or a\n    :class:`telegram.Update`.\n\n    Args:\n        entity (:obj:`Update` | :obj:`Message`) The ``update`` or ``message`` to extract from\n\n    Returns:\n        str: One of ``Message.MESSAGE_TYPES``\n\n    \"\"\"\n\n    # Importing on file-level yields cyclic Import Errors\n    from telegram import Message\n    from telegram import Update\n\n    if isinstance(entity, Message):\n        message = entity\n    elif isinstance(entity, Update):\n        message = entity.effective_message\n    else:\n        raise TypeError(\"entity is not Message or Update (got: {})\".format(type(entity)))\n\n    for i in Message.MESSAGE_TYPES:\n        if getattr(message, i, None):\n            return i\n\n    return None\n", "path": "telegram/utils/helpers.py"}], "after_files": [{"content": "#!/usr/bin/env python\n#\n# A library that provides a Python interface to the Telegram Bot API\n# Copyright (C) 2015-2018\n# Leandro Toledo de Souza <devs@python-telegram-bot.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Lesser Public License for more details.\n#\n# You should have received a copy of the GNU Lesser Public License\n# along with this program.  If not, see [http://www.gnu.org/licenses/].\n\"\"\"This module contains helper functions.\"\"\"\nfrom html import escape\n\nimport re\nimport signal\nfrom datetime import datetime\n\n# From https://stackoverflow.com/questions/2549939/get-signal-names-from-numbers-in-python\n_signames = {v: k\n             for k, v in reversed(sorted(vars(signal).items()))\n             if k.startswith('SIG') and not k.startswith('SIG_')}\n\n\ndef get_signal_name(signum):\n    \"\"\"Returns the signal name of the given signal number.\"\"\"\n    return _signames[signum]\n\n\n# Not using future.backports.datetime here as datetime value might be an input from the user,\n# making every isinstace() call more delicate. So we just use our own compat layer.\nif hasattr(datetime, 'timestamp'):\n    # Python 3.3+\n    def _timestamp(dt_obj):\n        return dt_obj.timestamp()\nelse:\n    # Python < 3.3 (incl 2.7)\n    from time import mktime\n\n    def _timestamp(dt_obj):\n        return mktime(dt_obj.timetuple())\n\n\ndef escape_markdown(text):\n    \"\"\"Helper function to escape telegram markup symbols.\"\"\"\n    escape_chars = '\\*_`\\['\n    return re.sub(r'([%s])' % escape_chars, r'\\\\\\1', text)\n\n\ndef to_timestamp(dt_obj):\n    \"\"\"\n    Args:\n        dt_obj (:class:`datetime.datetime`):\n\n    Returns:\n        int:\n\n    \"\"\"\n    if not dt_obj:\n        return None\n\n    return int(_timestamp(dt_obj))\n\n\ndef from_timestamp(unixtime):\n    \"\"\"\n    Args:\n        unixtime (int):\n\n    Returns:\n        datetime.datetime:\n\n    \"\"\"\n    if not unixtime:\n        return None\n\n    return datetime.fromtimestamp(unixtime)\n\n\ndef mention_html(user_id, name):\n    \"\"\"\n    Args:\n        user_id (:obj:`int`) The user's id which you want to mention.\n        name (:obj:`str`) The name the mention is showing.\n\n    Returns:\n        :obj:`str`: The inline mention for the user as html.\n    \"\"\"\n    if isinstance(user_id, int):\n        return u'<a href=\"tg://user?id={}\">{}</a>'.format(user_id, escape(name))\n\n\ndef mention_markdown(user_id, name):\n    \"\"\"\n    Args:\n        user_id (:obj:`int`) The user's id which you want to mention.\n        name (:obj:`str`) The name the mention is showing.\n\n    Returns:\n        :obj:`str`: The inline mention for the user as markdown.\n    \"\"\"\n    if isinstance(user_id, int):\n        return u'[{}](tg://user?id={})'.format(escape_markdown(name), user_id)\n\n\ndef effective_message_type(entity):\n    \"\"\"\n    Extracts the type of message as a string identifier from a :class:`telegram.Message` or a\n    :class:`telegram.Update`.\n\n    Args:\n        entity (:obj:`Update` | :obj:`Message`) The ``update`` or ``message`` to extract from\n\n    Returns:\n        str: One of ``Message.MESSAGE_TYPES``\n\n    \"\"\"\n\n    # Importing on file-level yields cyclic Import Errors\n    from telegram import Message\n    from telegram import Update\n\n    if isinstance(entity, Message):\n        message = entity\n    elif isinstance(entity, Update):\n        message = entity.effective_message\n    else:\n        raise TypeError(\"entity is not Message or Update (got: {})\".format(type(entity)))\n\n    for i in Message.MESSAGE_TYPES:\n        if getattr(message, i, None):\n            return i\n\n    return None\n", "path": "telegram/utils/helpers.py"}]}