summaryrefslogtreecommitdiff
path: root/tests/extmod/ujson_load_readinto.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extmod/ujson_load_readinto.py')
-rw-r--r--tests/extmod/ujson_load_readinto.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/extmod/ujson_load_readinto.py b/tests/extmod/ujson_load_readinto.py
index a277f40ef..001aa4fb2 100644
--- a/tests/extmod/ujson_load_readinto.py
+++ b/tests/extmod/ujson_load_readinto.py
@@ -2,6 +2,7 @@ import ujson as json
# Test that json can load from any object with readinto
+
class Buffer:
def __init__(self, data):
self._data = data
@@ -12,11 +13,12 @@ class Buffer:
remaining = len(self._data) - self._i
end = min(end, len(self._data))
l = min(len(buf), remaining)
- buf[:l] = self._data[self._i:end]
+ buf[:l] = self._data[self._i : end]
self._i += l
return l
-print(json.load(Buffer(b'null')))
+
+print(json.load(Buffer(b"null")))
print(json.load(Buffer(b'"abc\\u0064e"')))
-print(json.load(Buffer(b'[false, true, 1, -2]')))
+print(json.load(Buffer(b"[false, true, 1, -2]")))
print(json.load(Buffer(b'{"a":true}')))