Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hide/toolkit/toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def run_task(
"""
try:
result = self.client.run_task(
project_id=self.project.id, command=command, alias=alias
project_id=self.project.id, command=command, alias=alias, timeout=timeout
)
return f"exit code: {result.exit_code}\nstdout: {result.stdout}\nstderr: {result.stderr}"
except Exception as e:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_hide_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ def test_run_task_command_and_alias(client):
client.run_task(PROJECT_ID, command="echo Hello", alias="build")


def test_run_task_negative_timeout(client):
with pytest.raises(HideClientError, match="Timeout must be a positive integer"):
client.run_task(PROJECT_ID, command="echo Hello", timeout=-1)


def test_create_file_success(client):
with patch("requests.post") as mock_post:
mock_post.return_value = Mock(ok=True, json=lambda: FILE)
Expand Down