mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Add VSCode URL support and worker ports to sandbox services (#11426)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -94,7 +94,8 @@ def mock_running_container():
|
||||
container.attrs = {
|
||||
'Created': '2024-01-15T10:30:00.000000000Z',
|
||||
'Config': {
|
||||
'Env': ['OH_SESSION_API_KEYS_0=session_key_123', 'OTHER_VAR=other_value']
|
||||
'Env': ['OH_SESSION_API_KEYS_0=session_key_123', 'OTHER_VAR=other_value'],
|
||||
'WorkingDir': '/workspace',
|
||||
},
|
||||
'NetworkSettings': {
|
||||
'Ports': {
|
||||
@@ -629,7 +630,10 @@ class TestDockerSandboxService:
|
||||
assert agent_url.url == 'http://localhost:12345'
|
||||
|
||||
vscode_url = next(url for url in result.exposed_urls if url.name == VSCODE)
|
||||
assert vscode_url.url == 'http://localhost:12346'
|
||||
assert (
|
||||
vscode_url.url
|
||||
== 'http://localhost:12346/?tkn=session_key_123&folder=/workspace'
|
||||
)
|
||||
|
||||
async def test_container_to_sandbox_info_invalid_created_time(self, service):
|
||||
"""Test conversion with invalid creation timestamp."""
|
||||
|
||||
Reference in New Issue
Block a user