Skip to content

Commit

Permalink
format tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonw committed Jun 13, 2024
1 parent 2bd13e4 commit 9869971
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from daisy.messages import AcquireBlock, ReleaseBlock, SendBlock, ExceptionMessage
from daisy.tcp import TCPServer


def run_test_server(block, conn):
server = TCPServer()
conn.send(server.address)
Expand All @@ -25,21 +26,20 @@ def run_test_server(block, conn):
# handle return_block message
message = server.get_message(timeout=1)
try:
assert (isinstance(message, ReleaseBlock))
assert (message.block.status == daisy.BlockStatus.SUCCESS)
assert isinstance(message, ReleaseBlock)
assert message.block.status == daisy.BlockStatus.SUCCESS
except Exception as e:
message.stream.send_message(ExceptionMessage(e))
conn.send(1)
conn.close()


def test_basic():
roi = daisy.Roi((0, 0, 0), (10, 10, 10))
task_id = 1
block = daisy.Block(roi, roi, roi, block_id=1, task_id=task_id)
parent_conn, child_conn = mp.Pipe()
server_process = mp.Process(
target=run_test_server, args=(block, child_conn)
)
server_process = mp.Process(target=run_test_server, args=(block, child_conn))
server_process.start()
host, port = parent_conn.recv()
context = daisy.Context(hostname=host, port=port, task_id=task_id, worker_id=1)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
def process_block(block):
print("Processing block %s" % block)


def test_basic():

task = daisy.Task(
Expand All @@ -26,4 +27,3 @@ def test_basic():

server = daisy.Server()
server.run_blockwise([task])

0 comments on commit 9869971

Please sign in to comment.