Skip to content

Commit

Permalink
bug fix in server
Browse files Browse the repository at this point in the history
  • Loading branch information
mcencini committed Oct 31, 2024
1 parent 760390c commit 748a19e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pulserver/_server/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def handle_client_connection(config, client_socket, plugins, logger):
logger.info(f"Calling {function_name} with args {kwargs}")

# Run design function
result_buffer, optional_buffer = function(**kwargs)
result_buffer, optional_buffer = function(kwargs)

# Log the output to the function-specific log file
function_logger.info(f"Output buffer: {result_buffer}")
Expand Down
6 changes: 3 additions & 3 deletions tests/_server/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def test_handle_client_connection_valid_function(
handle_client_connection(sample_config, client_socket, plugins, logger)

# Check that the function was called correctly
plugins["foo"].assert_called_once_with(FOVx=256.0, Nx=128)
plugins["foo"].assert_called_once_with({"FOVx": 256.0, "Nx": 128})

# Check that logging was done correctly
logger.info.assert_called_once_with(
Expand Down Expand Up @@ -403,7 +403,7 @@ def test_handle_client_connection_no_optional_buffer(
logger = main_logger

# Mock plugins with an example function that returns no optional buffer
def mock_plugin(**kwargs):
def mock_plugin(kwargs):
return b"result_buffer", None

plugins["foo"] = MagicMock(side_effect=mock_plugin)
Expand All @@ -420,7 +420,7 @@ def mock_plugin(**kwargs):
handle_client_connection(sample_config, client_socket, plugins, logger)

# Check that the function was called correctly
plugins["foo"].assert_called_once_with(FOVx=256.0, Nx=128)
plugins["foo"].assert_called_once_with({"FOVx": 256.0, "Nx": 128})

# Check that logging was done correctly
logger.info.assert_called_once_with(
Expand Down

0 comments on commit 748a19e

Please sign in to comment.