Skip to content

Commit 11fdb3f

Browse files
committed
refactor: Update test suite and configuration to reflect UCloud/Agentbox branding and domains.
1 parent 2f5b35f commit 11fdb3f

9 files changed

Lines changed: 19 additions & 19 deletions

File tree

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# content of pytest.ini
22
[pytest]
33
markers =
4-
skip_debug: skip test if E2B_DEBUG is set.
4+
skip_debug: skip test if AGENTBOX_DEBUG is set.
55

66
asyncio_mode=auto
77
addopts = "--import-mode=importlib"

tests/async/sandbox_async/test_internet_access.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async def test_internet_access_enabled(async_sandbox_factory):
1010

1111
# Test internet connectivity by making a curl request to a reliable external site
1212
result = await sbx.commands.run(
13-
"curl -s -o /dev/null -w '%{http_code}' https://e2b.dev"
13+
"curl -s -o /dev/null -w '%{http_code}' https://sandbox.ucloudai.com"
1414
)
1515
assert result.exit_code == 0
1616
assert result.stdout.strip() == "200"
@@ -24,7 +24,7 @@ async def test_internet_access_disabled(async_sandbox_factory):
2424
# Test that internet connectivity is blocked by making a curl request
2525
with pytest.raises(CommandExitException) as exc_info:
2626
await sbx.commands.run(
27-
"curl --connect-timeout 3 --max-time 5 -Is https://e2b.dev"
27+
"curl --connect-timeout 3 --max-time 5 -Is https://sandbox.ucloudai.com"
2828
)
2929
# The command should fail or timeout when internet access is disabled
3030
assert exc_info.value.exit_code != 0
@@ -36,7 +36,7 @@ async def test_internet_access_default(async_sandbox):
3636
# Test internet connectivity by making a curl request to a reliable external site
3737

3838
result = await async_sandbox.commands.run(
39-
"curl -s -o /dev/null -w '%{http_code}' https://e2b.dev"
39+
"curl -s -o /dev/null -w '%{http_code}' https://sandbox.ucloudai.com"
4040
)
4141
assert result.exit_code == 0
4242
assert result.stdout.strip() == "200"

tests/async/template_async/test_background_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async def test_build_in_background_should_start_build_and_return_info():
1717
.set_start_cmd('echo "Hello"', wait_for_timeout(10_000))
1818
)
1919

20-
alias = f"e2b-test-{uuid.uuid4()}"
20+
alias = f"ucloud-test-{uuid.uuid4()}"
2121

2222
build_info = await AsyncTemplate.build_in_background(
2323
template,

tests/async/template_async/test_stacktrace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async def _expect_to_throw_and_check_trace(func, expected_method: str):
9292

9393
@pytest.mark.skip_debug()
9494
async def test_traces_on_from_image(async_build):
95-
template = AsyncTemplate().from_image("e2b.dev/this-image-does-not-exist")
95+
template = AsyncTemplate().from_image("sandbox.ucloudai.com/this-image-does-not-exist")
9696
await _expect_to_throw_and_check_trace(
9797
lambda: async_build(template, alias="from_image", skip_cache=True), "from_image"
9898
)

tests/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def _build(
103103
):
104104
return Template.build(
105105
template,
106-
alias=alias or f"e2b-test-{uuid4()}",
106+
alias=alias or f"ucloud-test-{uuid4()}",
107107
cpu_count=1,
108108
memory_mb=1024,
109109
skip_cache=skip_cache,
@@ -123,7 +123,7 @@ async def _async_build(
123123
):
124124
return await AsyncTemplate.build(
125125
template,
126-
alias=alias or f"e2b-test-{uuid4()}",
126+
alias=alias or f"ucloud-test-{uuid4()}",
127127
cpu_count=1,
128128
memory_mb=1024,
129129
skip_cache=skip_cache,
@@ -135,14 +135,14 @@ async def _async_build(
135135

136136
@pytest.fixture
137137
def debug():
138-
return os.getenv("E2B_DEBUG") is not None
138+
return os.getenv("AGENTBOX_DEBUG") is not None
139139

140140

141141
@pytest.fixture(autouse=True)
142142
def skip_by_debug(request, debug):
143143
if request.node.get_closest_marker("skip_debug"):
144144
if debug:
145-
pytest.skip("skipped because E2B_DEBUG is set")
145+
pytest.skip("skipped because AGENTBOX_DEBUG is set")
146146

147147

148148
class Helpers:

tests/sync/sandbox_sync/test_internet_access.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def test_internet_access_enabled(sandbox_factory):
99
sbx = sandbox_factory(allow_internet_access=True)
1010

1111
# Test internet connectivity by making a curl request to a reliable external site
12-
result = sbx.commands.run("curl -s -o /dev/null -w '%{http_code}' https://e2b.dev")
12+
result = sbx.commands.run("curl -s -o /dev/null -w '%{http_code}' https://sandbox.ucloudai.com")
1313
assert result.exit_code == 0
1414
assert result.stdout.strip() == "200"
1515

@@ -21,7 +21,7 @@ def test_internet_access_disabled(sandbox_factory):
2121

2222
# Test that internet connectivity is blocked by making a curl request
2323
with pytest.raises(CommandExitException) as exc_info:
24-
sbx.commands.run("curl --connect-timeout 3 --max-time 5 -Is https://e2b.dev")
24+
sbx.commands.run("curl --connect-timeout 3 --max-time 5 -Is https://sandbox.ucloudai.com")
2525
# The command should fail or timeout when internet access is disabled
2626
assert exc_info.value.exit_code != 0
2727

@@ -32,7 +32,7 @@ def test_internet_access_default(sandbox):
3232

3333
# Test internet connectivity by making a curl request to a reliable external site
3434
result = sandbox.commands.run(
35-
"curl -s -o /dev/null -w '%{http_code}' https://e2b.dev"
35+
"curl -s -o /dev/null -w '%{http_code}' https://sandbox.ucloudai.com"
3636
)
3737
assert result.exit_code == 0
3838
assert result.stdout.strip() == "200"

tests/sync/template_sync/test_background_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_build_in_background_should_start_build_and_return_info():
1717
.set_start_cmd('echo "Hello"', wait_for_timeout(10_000))
1818
)
1919

20-
alias = f"e2b-test-{uuid.uuid4()}"
20+
alias = f"ucloud-test-{uuid.uuid4()}"
2121

2222
build_info = Template.build_in_background(
2323
template,

tests/sync/template_sync/test_stacktrace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _expect_to_throw_and_check_trace(func, expected_method: str):
9393
@pytest.mark.skip_debug()
9494
def test_traces_on_from_image(build):
9595
template = Template()
96-
template = template.from_image("e2b.dev/this-image-does-not-exist")
96+
template = template.from_image("sandbox.ucloudai.com/this-image-does-not-exist")
9797
_expect_to_throw_and_check_trace(
9898
lambda: build(template, alias="from_image", skip_cache=True), "from_image"
9999
)

tests/test_connection_config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33

44
def test_api_url_defaults_correctly(monkeypatch):
5-
monkeypatch.setenv("E2B_DOMAIN", "")
5+
monkeypatch.setenv("AGENTBOX_DOMAIN", "")
66

77
config = ConnectionConfig()
8-
assert config.api_url == "https://api.e2b.app"
8+
assert config.api_url == "https://api.sandbox.ucloudai.com"
99

1010

1111
def test_api_url_in_args():
@@ -14,14 +14,14 @@ def test_api_url_in_args():
1414

1515

1616
def test_api_url_in_env_var(monkeypatch):
17-
monkeypatch.setenv("E2B_API_URL", "http://localhost:8080")
17+
monkeypatch.setenv("AGENTBOX_API_URL", "http://localhost:8080")
1818

1919
config = ConnectionConfig()
2020
assert config.api_url == "http://localhost:8080"
2121

2222

2323
def test_api_url_has_correct_priority(monkeypatch):
24-
monkeypatch.setenv("E2B_API_URL", "http://localhost:1111")
24+
monkeypatch.setenv("AGENTBOX_API_URL", "http://localhost:1111")
2525

2626
config = ConnectionConfig(api_url="http://localhost:8080")
2727
assert config.api_url == "http://localhost:8080"

0 commit comments

Comments
 (0)