Commit 50871f9a authored by Juraj Sloboda's avatar Juraj Sloboda

Resolve outstanding flake8 errors and warnings

parent 259813d9
[flake8]
max-line-length = 120
ignore = E203,W503
......@@ -14,3 +14,5 @@ Submodules
"""
from .pydtn import start
__all__ = ["start"]
......@@ -21,4 +21,6 @@ Note:
from .bp import BPAgent
__all__ = ["bp_agent"]
bp_agent = BPAgent()
......@@ -19,3 +19,5 @@ Note:
"""
from .tcp_cl import TCPCL
__all__ = ["TCPCL"]
......@@ -25,8 +25,16 @@ class TestCommon:
def test_decode(self):
assert sdnv_decode(bytearray(self.DATA_READ), 2) == (16, 3)
SERIAL_RESPONSE = b"\x9f\x89\x07\x00\x01\x82\x01etest2\x82\x01dtest\x82\x01\x00\x82\x1a$(\xde\xf4\x00\x19\x01,B%r\x87\t\x01\x00\x02\x04\x82\x18\x1e\x00D]}\xd8u\x87\x08\x02\x00\x02\x01\x00D\x98\x9d\x838\x87\x01\x00\x00\x02\x02aHDF\xa27\x80\xff"
SERIAL_TCPCL_RESPONSE = b"\x13M\x9f\x89\x07\x00\x01\x82\x01etest2\x82\x01dtest\x82\x01\x00\x82\x1a$(\xde\xf4\x00\x19\x01,B%r\x87\t\x01\x00\x02\x04\x82\x18\x1e\x00D]}\xd8u\x87\x08\x02\x00\x02\x01\x00D\x98\x9d\x838\x87\x01\x00\x00\x02\x02aHDF\xa27\x80\xff"
SERIAL_RESPONSE = (
b"\x9f\x89\x07\x00\x01\x82\x01etest2\x82\x01dtest\x82\x01\x00\x82\x1a$(\xde\xf4\x00\x19\x01,B"
+ b"%r\x87\t\x01\x00\x02\x04\x82\x18\x1e\x00D]}\xd8u\x87\x08\x02\x00\x02\x01\x00D\x98\x9d\x838"
+ b"\x87\x01\x00\x00\x02\x02aHDF\xa27\x80\xff"
)
SERIAL_TCPCL_RESPONSE = (
b"\x13M\x9f\x89\x07\x00\x01\x82\x01etest2\x82\x01dtest\x82\x01\x00\x82\x1a$(\xde\xf4\x00"
+ b"\x19\x01,B%r\x87\t\x01\x00\x02\x04\x82\x18\x1e\x00D]}\xd8u\x87\x08\x02\x00\x02\x01\x00"
+ b"D\x98\x9d\x838\x87\x01\x00\x00\x02\x02aHDF\xa27\x80\xff"
)
def test_serialize(self):
bundle = serialize_bundle("dtn:test", "dtn:test2", "H", NULL_EID, self.UNIX_TIME)
......
......@@ -10,3 +10,5 @@ Submodules
"""
from .pydtn_rest import start
__all__ = ["start"]
......@@ -43,11 +43,7 @@ async def handle_config(request):
try:
for msg in json["messages"]:
await bp_agent.create_and_send_config_msg(
destination,
msg["eid"],
msg["cla_address"],
int(msg["start_offset"]),
int(msg["end_offset"]),
destination, msg["eid"], msg["cla_address"], int(msg["start_offset"]), int(msg["end_offset"])
)
except NoContactError as e:
return web.json_response({"success": False, "details": f'There is no scheduled contact for node "{e.eid}"'})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment