Skip to content

Commit 330258e

Browse files
committed
update unit test
1 parent ca8766d commit 330258e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/core/src/awsService/sagemaker/sagemakerSpace.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ export class SagemakerSpace {
113113
DomainId: this.spaceApp.DomainId,
114114
SpaceName: this.spaceApp.SpaceName,
115115
})
116-
// If the App is not null and AppName exists -> use DescribeApp API (requires AppName as a parameter)
117-
// otherwise -> use ListApp API, with given DomainId and SpaceName
116+
// get app using ListApps API, with given DomainId and SpaceName
118117
let app
119118
if (this.spaceApp.DomainId && this.spaceApp.SpaceName) {
120119
app = await this.client.listAppForSpace(this.spaceApp.DomainId, this.spaceApp.SpaceName)

packages/core/src/test/awsService/sagemaker/explorer/sagemakerSpaceNode.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,13 @@ describe('SagemakerSpaceNode', function () {
112112
it('updates space app status', async function () {
113113
const describeSpaceStub = sinon.stub(SagemakerClient.prototype, 'describeSpace')
114114
describeSpaceStub.resolves({ SpaceName: 'TestSpace', Status: 'InService', $metadata: {} })
115-
describeAppStub.resolves({ AppName: 'TestApp', Status: 'InService', $metadata: {} })
115+
116+
const listAppForSpaceStub = sinon.stub(SagemakerClient.prototype, 'listAppForSpace')
117+
listAppForSpaceStub.resolves({ AppName: 'TestApp', Status: 'InService' })
116118

117119
await testSpaceAppNode.updateSpaceAppStatus()
118120

119121
sinon.assert.calledOnce(describeSpaceStub)
120-
sinon.assert.calledOnce(describeAppStub)
122+
sinon.assert.calledOnce(listAppForSpaceStub)
121123
})
122124
})

0 commit comments

Comments
 (0)