* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible. * Replaced tounicode() with tostr() * Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO. * Replaced all unichr() with chr() * Misc minor tweaks and fixes
10 lines
264 B
Python
10 lines
264 B
Python
from fontTools.misc.textTools import pad
|
|
|
|
|
|
def test_pad():
|
|
assert len(pad(b'abcd', 4)) == 4
|
|
assert len(pad(b'abcde', 2)) == 6
|
|
assert len(pad(b'abcde', 4)) == 8
|
|
assert pad(b'abcdef', 4) == b'abcdef\x00\x00'
|
|
assert pad(b'abcdef', 1) == b'abcdef'
|