-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
11 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import tempfile | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
async def workspace(): | ||
with tempfile.TemporaryDirectory() as temp_dir: | ||
yield temp_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,19 @@ | ||
import tempfile | ||
|
||
import pytest | ||
|
||
from ipybox import ExecutionClient, ExecutionContainer | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
async def workspace(): | ||
with tempfile.TemporaryDirectory() as temp_dir: | ||
yield temp_dir | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
async def executor(workspace: str): | ||
async with ExecutionContainer( | ||
tag="ghcr.io/gradion-ai/ipybox:minimal", | ||
binds={workspace: "workspace"}, | ||
env={"TEST_VAR": "test_val"}, | ||
) as container: | ||
async with ExecutionClient(host="localhost", port=container.port) as client: | ||
yield client | ||
|
||
|
||
@pytest.mark.asyncio(loop_scope="module") | ||
async def test_single_command_output(executor): | ||
async def test_basic_functionality(executor): | ||
result = await executor.execute("print('Hello, world!')") | ||
assert result.text == "Hello, world!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters