Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannah Bast committed Jan 30, 2025
1 parent 6481cf0 commit 0a30c6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/qlever/commands/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ def execute(self, args) -> bool:
try:
process = run_command(
start_cmd,
return_output=False,
show_output=False,
as_pipe=args.run_in_foreground,
)
except Exception as e:
Expand Down
12 changes: 10 additions & 2 deletions test/qlever/commands/test_start_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,14 @@ def test_execute_kills_existing_server_on_same_port(
# Assert that run_command was called exactly twice with the
# correct arguments in order
mock_run_command.assert_has_calls(
[call(run_call_1), call(run_call_2)], any_order=False
[
call(run_call_1),
call(
run_call_2,
as_pipe=False,
),
],
any_order=False,
)
# Ensure execution was successful
self.assertTrue(result)
Expand Down Expand Up @@ -586,6 +593,7 @@ def test_execute_containerize_and_description(
args.description = "TestDescription"
args.text_description = "TestTextDescription"
args.access_token = "TestToken"
args.run_in_foreground = False

# Mock server is not alive initially, then alive after starting
mock_is_qlever_server_alive.side_effect = [False, True]
Expand Down Expand Up @@ -638,7 +646,7 @@ def test_execute_containerize_and_description(
mock_run_command.assert_has_calls(
[
call(run_call_1),
call(run_call_2),
call(run_call_2, as_pipe=False),
call(run_call_3),
call(run_call_4),
],
Expand Down

0 comments on commit 0a30c6d

Please sign in to comment.