Skip to content

Commit

Permalink
Renaming stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
julieg18 committed Apr 26, 2023
1 parent 212c8a4 commit a05091b
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 64 deletions.
8 changes: 4 additions & 4 deletions extension/src/setup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,17 +339,17 @@ export class Setup
return this.sendDataToWebview()
}

public async getEnvDetails(): Promise<DvcCliDetails> {
public async getDvcCliDetails(): Promise<DvcCliDetails> {
const dvcPath = this.config.getCliPath()
const pythonBinPath = this.config.getPythonBinPath()
const cwd = getFirstWorkspaceFolder()

const { args, executable } = getOptions(pythonBinPath, dvcPath, cwd || '')
const commandArgs = args.length === 0 ? '' : ` ${args.join(' ')}`
const exampleCommand = executable + commandArgs
const command = executable + commandArgs

return {
exampleCommand,
command,
version: cwd ? await this.getCliVersion(cwd) : undefined
}
}
Expand All @@ -368,7 +368,7 @@ export class Setup

const pythonBinPath = await findPythonBinForInstall()

const dvcCliDetails = await this.getEnvDetails()
const dvcCliDetails = await this.getDvcCliDetails()

this.webviewMessages.sendWebviewMessage({
canGitInitialize,
Expand Down
2 changes: 1 addition & 1 deletion extension/src/setup/webview/contract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type DvcCliDetails = {
exampleCommand: string
command: string
version: string | undefined
}

Expand Down
12 changes: 6 additions & 6 deletions extension/src/test/suite/setup/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ suite('Setup Test Suite', () => {
expect(mockSendMessage).to.be.calledWithExactly({
canGitInitialize: true,
cliCompatible: undefined,
dvcCliDetails: { exampleCommand: 'dvc', version: undefined },
dvcCliDetails: { command: 'dvc', version: undefined },
hasData: false,
isPythonExtensionInstalled: false,
isStudioConnected: false,
Expand Down Expand Up @@ -280,7 +280,7 @@ suite('Setup Test Suite', () => {
expect(mockSendMessage).to.be.calledWithExactly({
canGitInitialize: true,
cliCompatible: true,
dvcCliDetails: { exampleCommand: 'dvc', version: MIN_CLI_VERSION },
dvcCliDetails: { command: 'dvc', version: MIN_CLI_VERSION },
hasData: false,
isPythonExtensionInstalled: false,
isStudioConnected: false,
Expand Down Expand Up @@ -328,7 +328,7 @@ suite('Setup Test Suite', () => {
canGitInitialize: false,
cliCompatible: true,
dvcCliDetails: {
exampleCommand: 'dvc',
command: 'dvc',
version: MIN_CLI_VERSION
},
hasData: false,
Expand Down Expand Up @@ -378,7 +378,7 @@ suite('Setup Test Suite', () => {
canGitInitialize: false,
cliCompatible: true,
dvcCliDetails: {
exampleCommand: 'dvc',
command: 'dvc',
version: MIN_CLI_VERSION
},
hasData: false,
Expand Down Expand Up @@ -579,7 +579,7 @@ suite('Setup Test Suite', () => {
mockRunSetup.restore()
stub(config, 'isPythonExtensionUsed').returns(false)
stub(config, 'getPythonBinPath').resolves(join('python'))
stub(setup, 'getEnvDetails').resolves(undefined)
stub(setup, 'getDvcCliDetails').resolves(undefined)

mockVersion.resetBehavior()
mockVersion
Expand Down Expand Up @@ -639,7 +639,7 @@ suite('Setup Test Suite', () => {
mockExecuteCommand.restore()
mockRunSetup.restore()
stub(config, 'isPythonExtensionUsed').returns(true)
stub(setup, 'getEnvDetails').resolves(undefined)
stub(setup, 'getDvcCliDetails').resolves(undefined)

mockVersion.resetBehavior()
mockVersion.rejects(new Error('no CLI here'))
Expand Down
Loading

0 comments on commit a05091b

Please sign in to comment.