Skip to content

Commit 7306a5a

Browse files
committed
verify context id
1 parent dc14e0f commit 7306a5a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

js/tests/contexts.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sandboxTest('create context with no options', async ({ sandbox }) => {
1111
const contexts = await sandbox.listCodeContexts()
1212
const lastContext = contexts[contexts.length - 1]
1313

14-
expect(lastContext.id).toBeDefined()
14+
expect(lastContext.id).toBe(context.id)
1515
expect(lastContext.language).toBe(context.language)
1616
expect(lastContext.cwd).toBe(context.cwd)
1717
})
@@ -28,7 +28,7 @@ sandboxTest('create context with options', async ({ sandbox }) => {
2828
const contexts = await sandbox.listCodeContexts()
2929
const lastContext = contexts[contexts.length - 1]
3030

31-
expect(lastContext.id).toBeDefined()
31+
expect(lastContext.id).toBe(context.id)
3232
expect(lastContext.language).toBe(context.language)
3333
expect(lastContext.cwd).toBe(context.cwd)
3434
})

python/tests/async/test_async_contexts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async def test_create_context_with_no_options(async_sandbox: AsyncSandbox):
1111
contexts = await async_sandbox.list_code_contexts()
1212
last_context = contexts[-1]
1313

14-
assert last_context.id is not None
14+
assert last_context.id == context.id
1515
assert last_context.language == context.language
1616
assert last_context.cwd == context.cwd
1717

@@ -28,7 +28,7 @@ async def test_create_context_with_options(async_sandbox: AsyncSandbox):
2828
contexts = await async_sandbox.list_code_contexts()
2929
last_context = contexts[-1]
3030

31-
assert last_context.id is not None
31+
assert last_context.id == context.id
3232
assert last_context.language == context.language
3333
assert last_context.cwd == context.cwd
3434

python/tests/sync/test_contexts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def test_create_context_with_no_options(sandbox: Sandbox):
1111
contexts = sandbox.list_code_contexts()
1212
last_context = contexts[-1]
1313

14-
assert last_context.id is not None
14+
assert last_context.id == context.id
1515
assert last_context.language == context.language
1616
assert last_context.cwd == context.cwd
1717

@@ -28,7 +28,7 @@ def test_create_context_with_options(sandbox: Sandbox):
2828
contexts = sandbox.list_code_contexts()
2929
last_context = contexts[-1]
3030

31-
assert last_context.id is not None
31+
assert last_context.id == context.id
3232
assert last_context.language == context.language
3333
assert last_context.cwd == context.cwd
3434

0 commit comments

Comments
 (0)