diff options
author | Tom Rini <trini@konsulko.com> | 2019-10-24 11:59:22 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-10-30 17:48:47 -0400 |
commit | 8060209a9278593519f73ba763e67f7aa219a732 (patch) | |
tree | d05992c0fc5de377bbbbb5f95c1830e9703d70b9 /test | |
parent | fd31fc172c626bdac2afd8af9f8482bfc21a5501 (diff) | |
download | u-boot-8060209a9278593519f73ba763e67f7aa219a732.tar.gz u-boot-8060209a9278593519f73ba763e67f7aa219a732.tar.xz u-boot-8060209a9278593519f73ba763e67f7aa219a732.zip |
test/py: test_ut.py: Ensure we use bytes
In the case of some unit tests we are working with providing a fake
flash device that we have written some text strings in to. In this case
we want to tell Python to encode things to bytes for us.
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Simon Glass <sjg@chromium.org> [on sandbox]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/py/tests/test_ut.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py index 62037d2c45..6c7b8dd2b3 100644 --- a/test/py/tests/test_ut.py +++ b/test/py/tests/test_ut.py @@ -10,14 +10,14 @@ def test_ut_dm_init(u_boot_console): fn = u_boot_console.config.source_dir + '/testflash.bin' if not os.path.exists(fn): - data = 'this is a test' - data += '\x00' * ((4 * 1024 * 1024) - len(data)) + data = b'this is a test' + data += b'\x00' * ((4 * 1024 * 1024) - len(data)) with open(fn, 'wb') as fh: fh.write(data) fn = u_boot_console.config.source_dir + '/spi.bin' if not os.path.exists(fn): - data = '\x00' * (2 * 1024 * 1024) + data = b'\x00' * (2 * 1024 * 1024) with open(fn, 'wb') as fh: fh.write(data) |