Skip to content

Commit

Permalink
fixed pycodestyle E275 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
LionelCons committed Feb 14, 2024
1 parent 426820b commit b216cb4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions example/generator_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def generate_messages():
header_value_size=-32,
header_name_prefix="rnd-")
msg = gen.message()
assert(len(msg.body) == 1024)
assert(len(msg.header) == 6)
assert (len(msg.body) == 1024)
assert (len(msg.header) == 6)
print("...message generation OK!")


Expand All @@ -56,7 +56,7 @@ def generate_int():
index = 100
for counter in range(1000): # pylint: disable=W0612
integer = generator.rndint(100)
assert(integer >= 0 and integer <= index * 2)
assert (integer >= 0 and integer <= index * 2)
print("...integers generation OK!")


Expand All @@ -67,7 +67,7 @@ def generate_bin():
print("generating binary string")
length = 1024
binstr = generator.rndbin(length)
assert(len(binstr) == length)
assert (len(binstr) == length)
print("...binary string generation OK!")


Expand All @@ -78,7 +78,7 @@ def generate_b64():
print("generating base64 string")
length = 1024
b64str = generator.rndb64(length)
assert(len(b64str) == length)
assert (len(b64str) == length)
print("...base64 string generation OK!")


Expand All @@ -89,7 +89,7 @@ def generate_str():
print("generating string")
length = 1024
string = generator.rndstr(length)
assert(len(string) == length)
assert (len(string) == length)
print("...string generation OK!")


Expand Down
12 changes: 6 additions & 6 deletions example/message_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ def handle_message():
msg1 = Message(body="hello world!".encode("utf-8"), header={"h1": "val1"})

msg2 = Message(body="hello world!".encode("utf-8"), header={"h1": "val1"})
assert(msg1 == msg2)
assert (msg1 == msg2)
msg2 = msg1.serialize()
msg2 = deserialize(msg2)
assert(msg1 == msg2)
assert (msg1 == msg2)

msg3 = deserialize('{"body": "hello world!", "header": {"h1": "val1"}}')
assert(msg1 == msg3)
assert (msg1 == msg3)

tmp = msg1.stringify()
msg4 = destringify(tmp)
assert(msg1 == msg4)
assert (msg1 == msg4)

msg5 = msg1.jsonify()
assert(isinstance(msg5, dict))
assert (isinstance(msg5, dict))
msg5 = dejsonify(msg5)
assert(msg1 == msg5)
assert (msg1 == msg5)

print("...handle message OK!")

Expand Down
8 changes: 4 additions & 4 deletions example/queue_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ def dirq_normal():
post_msg2 = None
if dirq.lock(element2):
post_msg2 = dirq.get_message(element2)
assert(post_msg2 == msg2)
assert (post_msg2 == msg2)
post_msg1 = None
if dirq.lock(element1):
post_msg1 = dirq.get_message(element1)
assert(post_msg1 == msg1)
assert (post_msg1 == msg1)
print("...dirq normal OK!")


Expand All @@ -76,11 +76,11 @@ def dirq_simple():
post_msg2 = None
if dirq.lock(element2):
post_msg2 = dirq.get_message(element2)
assert(post_msg2 == msg2)
assert (post_msg2 == msg2)
post_msg1 = None
if dirq.lock(element1):
post_msg1 = dirq.get_message(element1)
assert(post_msg1 == msg1)
assert (post_msg1 == msg1)
print("...dirq simple OK!")


Expand Down
4 changes: 2 additions & 2 deletions messaging/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def jsonify(self, option=dict()):
_base64_it(obj)
else:
obj["body"] = self.body
del(obj["encoding"])
del (obj["encoding"])
else: # binary body
obj["encoding"] = dict()
if compression:
Expand All @@ -474,7 +474,7 @@ def jsonify(self, option=dict()):
if obj["encoding"]:
obj["encoding"] = "+".join(obj["encoding"].keys())
else:
del(obj["encoding"])
del (obj["encoding"])
return obj

def stringify(self, option=dict()):
Expand Down

0 comments on commit b216cb4

Please sign in to comment.