From 1309368eb4f3bb90872772ba9d09cad9d20927f1 Mon Sep 17 00:00:00 2001 From: "Klaus Foerster (marvin)" Date: Fri, 30 Nov 2018 17:39:26 +0100 Subject: [PATCH] flake8 --- pypeman/message.py | 1 - pypeman/msgstore.py | 2 +- pypeman/tests/test_hlp_serializer.py | 9 ++++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pypeman/message.py b/pypeman/message.py index 563a0b80..fd8e1996 100644 --- a/pypeman/message.py +++ b/pypeman/message.py @@ -14,7 +14,6 @@ DEFAULT_ENCODER_CLS = B64PickleEncoder - class Message(): """ A message is the unity of informations exchanged between nodes of a diff --git a/pypeman/msgstore.py b/pypeman/msgstore.py index 81139a7a..e1a459dc 100644 --- a/pypeman/msgstore.py +++ b/pypeman/msgstore.py @@ -255,7 +255,7 @@ async def get(self, id): # TODO: we might implement an async version for huge files # - use either https://github.com/Tinche/aiofiles # - read chunks + add sleep(0) (not good for blocking network file systems) - + msg = Message.from_json(f.read().decode('utf-8')) return {'id': id, 'state': await self.get_message_state(id), 'message': msg} diff --git a/pypeman/tests/test_hlp_serializer.py b/pypeman/tests/test_hlp_serializer.py index 70401c8c..8deb8282 100644 --- a/pypeman/tests/test_hlp_serializer.py +++ b/pypeman/tests/test_hlp_serializer.py @@ -32,7 +32,7 @@ class TestSerializer: "utf_string": "h\xe9llo", "utf_bytes": b"h\xe9llo", "allbytes": all_bytes, - } + } # JsonableEncoder and B64PickleEncoder should be able to handle this structvals_1 = { @@ -49,10 +49,10 @@ class TestSerializer: "list_with_asciibytes": [0, "1", b"3"], "list_with_utfbytes": [0, "1", b"3'\xe9"], "list_with_anybytes": [0, "1", all_bytes], - "dict": {"key1" : 1, + "dict": {"key1": 1, 2: "val", "ke\xe0": 1.3, - }, + }, "object": SampleObject(), } @@ -74,9 +74,8 @@ def test_enc_dec_match_B64Pickle(self): codec = codec_cls() for name, val in sorted(cls.structvals_1.items()): self.check_encode_decode(codec, name, val) - + for codec_cls in [B64PickleEncoder]: codec = codec_cls() for name, val in sorted(cls.structvals_2.items()): self.check_encode_decode(codec, name, val) -