8000 lint · valid22/firebase-admin-python@fb68d14 · GitHub
[go: up one dir, main page]

Skip to content

Commit fb68d14

Browse files
committed
lint
1 parent 6ce5a78 commit fb68d14

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

firebase_admin/dynamic_links.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def __init__(self, app):
114114

115115
def _populated_request(self, url, options):
116116
days = options.duration_days
117-
url_quoted = urllib_parse.quote(url, safe="")
117+
url_quoted = urllib_parse.quote(url, "")
118118
return self._links_request.format(url_quoted, days)
119119

120120
def get_stats(self, url, options):

tests/test_dynamic_links.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,12 @@ def test_invalid_event_stats_list(self, arg):
201201
def test_empty_event_stats_list(self, arg):
202202
with pytest.raises(ValueError) as excinfo:
203203
dynamic_links.LinkStats(arg)
204-
assert 'elements of event stats must be "EventStats"' in excinfo.value.message
204+
assert'elements of event stats must be "EventStats"' in excinfo.value.message
205+
206+
207+
class TestQuoting(object):
208+
def test_quote(self):
209+
links_service = dynamic_links._get_link_service(None)
210+
link = links_service._populated_request("https://sample.com",
211+
dynamic_links.StatOptions(duration_days=1))
212+
assert link == 'https%3A%2F%2Fsample.com/linkStats?durationDays=1'

0 commit comments

Comments
 (0)
0