Skip to content

Commit 0f7eebe

Browse files
committed
add py command to test
1 parent 333774d commit 0f7eebe

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

step-generation/src/__tests__/delayInTrash.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,10 @@ describe('delayInTrash', () => {
5151
},
5252
},
5353
])
54+
expect(res.python).toBe(
55+
`
56+
mockPythonName.move_to(mock_trash_bin_1)
57+
protocol.delay(seconds=30)`.trimStart()
58+
)
5459
})
5560
})

step-generation/src/__tests__/delayInWasteChute.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ describe('delayInWasteChute', () => {
2929
const args = {
3030
pipetteId: 'p10SingleId',
3131
seconds: 30,
32+
destinationId: wasteChuteId,
3233
}
3334

3435
const result = delayInWasteChute(args, invariantContext, prevRobotState)
@@ -51,5 +52,10 @@ describe('delayInWasteChute', () => {
5152
},
5253
},
5354
])
55+
expect(res.python).toBe(
56+
`
57+
mockPythonName.move_to(mock_waste_chute_1)
58+
protocol.delay(seconds=30)`.trimStart()
59+
)
5460
})
5561
})

step-generation/src/__tests__/delayInWell.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,10 @@ describe('delayInWell', () => {
5353
},
5454
},
5555
])
56+
expect(res.python).toBe(
57+
`
58+
mockPythonName.move_to(mockPythonName["B1"].bottom(z=10))
59+
protocol.delay(seconds=30)`.trimStart()
60+
)
5661
})
5762
})

step-generation/src/commandCreators/compound/delayInTrash.ts

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
import {
2-
curryCommandCreator,
3-
getTrashBinAddressableAreaName,
4-
reduceCommandCreators,
5-
} from '../../utils'
1+
import { curryCommandCreator, reduceCommandCreators } from '../../utils'
62
import { ZERO_OFFSET } from '../../constants'
73
import { delay, moveToAddressableArea } from '../atomic'
84
import type { CommandCreator, CurriedCommandCreator } from '../../types'
9-
import type { CutoutId } from '@opentrons/shared-data'
105

116
interface DelayInTrashArgs {
127
destinationId: string
@@ -20,15 +15,11 @@ export const delayInTrash: CommandCreator<DelayInTrashArgs> = (
2015
prevRobotState
2116
) => {
2217
const { seconds, pipetteId, destinationId } = args
23-
const addressableAreaName = getTrashBinAddressableAreaName(
24-
invariantContext.additionalEquipmentEntities[destinationId]
25-
.location as CutoutId
26-
)
2718

2819
const commandCreators: CurriedCommandCreator[] = [
2920
curryCommandCreator(moveToAddressableArea, {
3021
pipetteId,
31-
addressableAreaName,
22+
fixtureId: destinationId,
3223
offset: ZERO_OFFSET,
3324
}),
3425
curryCommandCreator(delay, {

step-generation/src/commandCreators/compound/delayInWasteChute.ts

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import {
2-
curryCommandCreator,
3-
getWasteChuteAddressableAreaNamePip,
4-
reduceCommandCreators,
5-
} from '../../utils'
1+
import { curryCommandCreator, reduceCommandCreators } from '../../utils'
62
import { ZERO_OFFSET } from '../../constants'
73
import { delay, moveToAddressableArea } from '../atomic'
84
import type { CommandCreator, CurriedCommandCreator } from '../../types'
95

106
interface delayInWasteChuteArgs {
7+
destinationId: string
118
pipetteId: string
129
seconds: number
1310
}
@@ -17,14 +14,12 @@ export const delayInWasteChute: CommandCreator<delayInWasteChuteArgs> = (
1714
invariantContext,
1815
prevRobotState
1916
) => {
20-
const { seconds, pipetteId } = args
21-
const pipetteChannels =
22-
invariantContext.pipetteEntities[pipetteId].spec.channels
17+
const { seconds, pipetteId, destinationId } = args
2318

2419
const commandCreators: CurriedCommandCreator[] = [
2520
curryCommandCreator(moveToAddressableArea, {
2621
pipetteId,
27-
addressableAreaName: getWasteChuteAddressableAreaNamePip(pipetteChannels),
22+
fixtureId: destinationId,
2823
offset: ZERO_OFFSET,
2924
}),
3025
curryCommandCreator(delay, {

step-generation/src/utils/misc.ts

+1
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,7 @@ export const moveAndDelayLocationHelper: CommandCreator<MoveAndDelayLocationHelp
753753
} else if (trashOrLabware === 'wasteChute') {
754754
commands = [
755755
curryCommandCreator(delayInWasteChute, {
756+
destinationId,
756757
seconds,
757758
pipetteId,
758759
}),

0 commit comments

Comments
 (0)