summaryrefslogtreecommitdiff
path: root/tests/db
diff options
context:
space:
mode:
authorBen Finney <ben+python@benfinney.id.au>2018-04-23 16:28:43 +1000
committerBen Finney <ben@benfinney.id.au>2018-04-23 19:54:46 +1000
commit2441a4d7b3576eb3a1c519713974418638ab82ba (patch)
treedf3817e36d0946b554cc524cf11a22ef1478aeb7 /tests/db
parent0abc64f78e3c5f9ad3faf9a3b6339ccd6b15de71 (diff)
Refactor some long statements to allow shorter lines.
Diffstat (limited to 'tests/db')
-rw-r--r--tests/db/utils_test.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/db/utils_test.py b/tests/db/utils_test.py
index b1187fe3..9013f5ce 100644
--- a/tests/db/utils_test.py
+++ b/tests/db/utils_test.py
@@ -263,7 +263,9 @@ class TestDecodeHeader(unittest.TestCase):
"""
string = unicode_string.encode(encoding)
b64 = base64.encodebytes(string).strip()
- return (b'=?' + encoding.encode('utf-8') + b'?B?' + b64 + b'?=').decode('ascii')
+ result_bytes = b'=?' + encoding.encode('utf-8') + b'?B?' + b64 + b'?='
+ result = result_bytes.decode('ascii')
+ return result
def _test(self, teststring, expected):
@@ -317,7 +319,11 @@ class TestDecodeHeader(unittest.TestCase):
' again: ' + self._quote(part, 'utf-8') + \
' latin1: ' + self._base64(part, 'iso-8859-1') + \
' and ' + self._quote(part, 'iso-8859-1')
- expected = u'utf-8: ÄÖÜäöü again: ÄÖÜäöü latin1: ÄÖÜäöü and ÄÖÜäöü'
+ expected = u' '.join([
+ u'utf-8: ÄÖÜäöü',
+ u'again: ÄÖÜäöü',
+ u'latin1: ÄÖÜäöü and ÄÖÜäöü',
+ ])
self._test(text, expected)
def test_tabs_are_expanded_to_align_with_eigth_spaces(self):