chore: blacken (#375)
diff --git a/tests/test__helpers.py b/tests/test__helpers.py
index 79bdef3..3714af7 100644
--- a/tests/test__helpers.py
+++ b/tests/test__helpers.py
@@ -56,20 +56,18 @@
def test_datetime_to_secs():
- assert _helpers.datetime_to_secs(
- datetime.datetime(1970, 1, 1)) == 0
- assert _helpers.datetime_to_secs(
- datetime.datetime(1990, 5, 29)) == 643939200
+ assert _helpers.datetime_to_secs(datetime.datetime(1970, 1, 1)) == 0
+ assert _helpers.datetime_to_secs(datetime.datetime(1990, 5, 29)) == 643939200
def test_to_bytes_with_bytes():
- value = b'bytes-val'
+ value = b"bytes-val"
assert _helpers.to_bytes(value) == value
def test_to_bytes_with_unicode():
- value = u'string-val'
- encoded_value = b'string-val'
+ value = u"string-val"
+ encoded_value = b"string-val"
assert _helpers.to_bytes(value) == encoded_value
@@ -79,13 +77,13 @@
def test_from_bytes_with_unicode():
- value = u'bytes-val'
+ value = u"bytes-val"
assert _helpers.from_bytes(value) == value
def test_from_bytes_with_bytes():
- value = b'string-val'
- decoded_value = u'string-val'
+ value = b"string-val"
+ decoded_value = u"string-val"
assert _helpers.from_bytes(value) == decoded_value
@@ -101,53 +99,49 @@
def test_update_query_params_no_params():
- uri = 'http://www.google.com'
- updated = _helpers.update_query(uri, {'a': 'b'})
- assert updated == uri + '?a=b'
+ uri = "http://www.google.com"
+ updated = _helpers.update_query(uri, {"a": "b"})
+ assert updated == uri + "?a=b"
def test_update_query_existing_params():
- uri = 'http://www.google.com?x=y'
- updated = _helpers.update_query(uri, {'a': 'b', 'c': 'd&'})
- _assert_query(updated, {'x': ['y'], 'a': ['b'], 'c': ['d&']})
+ uri = "http://www.google.com?x=y"
+ updated = _helpers.update_query(uri, {"a": "b", "c": "d&"})
+ _assert_query(updated, {"x": ["y"], "a": ["b"], "c": ["d&"]})
def test_update_query_replace_param():
- base_uri = 'http://www.google.com'
- uri = base_uri + '?x=a'
- updated = _helpers.update_query(uri, {'x': 'b', 'y': 'c'})
- _assert_query(updated, {'x': ['b'], 'y': ['c']})
+ base_uri = "http://www.google.com"
+ uri = base_uri + "?x=a"
+ updated = _helpers.update_query(uri, {"x": "b", "y": "c"})
+ _assert_query(updated, {"x": ["b"], "y": ["c"]})
def test_update_query_remove_param():
- base_uri = 'http://www.google.com'
- uri = base_uri + '?x=a'
- updated = _helpers.update_query(uri, {'y': 'c'}, remove=['x'])
- _assert_query(updated, {'y': ['c']})
+ base_uri = "http://www.google.com"
+ uri = base_uri + "?x=a"
+ updated = _helpers.update_query(uri, {"y": "c"}, remove=["x"])
+ _assert_query(updated, {"y": ["c"]})
def test_scopes_to_string():
cases = [
- ('', ()),
- ('', []),
- ('', ('',)),
- ('', ['', ]),
- ('a', ('a',)),
- ('b', ['b', ]),
- ('a b', ['a', 'b']),
- ('a b', ('a', 'b')),
- ('a b', (s for s in ['a', 'b'])),
+ ("", ()),
+ ("", []),
+ ("", ("",)),
+ ("", [""]),
+ ("a", ("a",)),
+ ("b", ["b"]),
+ ("a b", ["a", "b"]),
+ ("a b", ("a", "b")),
+ ("a b", (s for s in ["a", "b"])),
]
for expected, case in cases:
assert _helpers.scopes_to_string(case) == expected
def test_string_to_scopes():
- cases = [
- ('', []),
- ('a', ['a']),
- ('a b c d e f', ['a', 'b', 'c', 'd', 'e', 'f']),
- ]
+ cases = [("", []), ("a", ["a"]), ("a b c d e f", ["a", "b", "c", "d", "e", "f"])]
for case, expected in cases:
assert _helpers.string_to_scopes(case) == expected
@@ -155,14 +149,14 @@
def test_padded_urlsafe_b64decode():
cases = [
- ('YQ==', b'a'),
- ('YQ', b'a'),
- ('YWE=', b'aa'),
- ('YWE', b'aa'),
- ('YWFhYQ==', b'aaaa'),
- ('YWFhYQ', b'aaaa'),
- ('YWFhYWE=', b'aaaaa'),
- ('YWFhYWE', b'aaaaa'),
+ ("YQ==", b"a"),
+ ("YQ", b"a"),
+ ("YWE=", b"aa"),
+ ("YWE", b"aa"),
+ ("YWFhYQ==", b"aaaa"),
+ ("YWFhYQ", b"aaaa"),
+ ("YWFhYWE=", b"aaaaa"),
+ ("YWFhYWE", b"aaaaa"),
]
for case, expected in cases:
@@ -170,12 +164,7 @@
def test_unpadded_urlsafe_b64encode():
- cases = [
- (b'', b''),
- (b'a', b'YQ'),
- (b'aa', b'YWE'),
- (b'aaa', b'YWFh'),
- ]
+ cases = [(b"", b""), (b"a", b"YQ"), (b"aa", b"YWE"), (b"aaa", b"YWFh")]
for case, expected in cases:
assert _helpers.unpadded_urlsafe_b64encode(case) == expected