@@ -17,14 +17,12 @@ import * as triggerUtils from '../../../client/pythonEnvironments/creation/commo
1717import * as windowApis from '../../../client/common/vscodeApis/windowApis' ;
1818import * as workspaceApis from '../../../client/common/vscodeApis/workspaceApis' ;
1919import * as commandApis from '../../../client/common/vscodeApis/commandApis' ;
20- import * as extDepApi from '../../../client/pythonEnvironments/common/externalDependencies' ;
2120import { registerTriggerForPipInTerminal } from '../../../client/pythonEnvironments/creation/globalPipInTerminalTrigger' ;
2221import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants' ;
2322import { Common , CreateEnv } from '../../../client/common/utils/localize' ;
2423
2524suite ( 'Global Pip in Terminal Trigger' , ( ) => {
2625 let shouldPromptToCreateEnvStub : sinon . SinonStub ;
27- let inExperimentStub : sinon . SinonStub ;
2826 let getWorkspaceFoldersStub : sinon . SinonStub ;
2927 let getWorkspaceFolderStub : sinon . SinonStub ;
3028 let isGlobalPythonSelectedStub : sinon . SinonStub ;
@@ -48,7 +46,6 @@ suite('Global Pip in Terminal Trigger', () => {
4846
4947 setup ( ( ) => {
5048 shouldPromptToCreateEnvStub = sinon . stub ( triggerUtils , 'shouldPromptToCreateEnv' ) ;
51- inExperimentStub = sinon . stub ( extDepApi , 'inExperiment' ) ;
5249
5350 getWorkspaceFoldersStub = sinon . stub ( workspaceApis , 'getWorkspaceFolders' ) ;
5451 getWorkspaceFoldersStub . returns ( [ workspace1 ] ) ;
@@ -88,7 +85,6 @@ suite('Global Pip in Terminal Trigger', () => {
8885
8986 test ( 'Should not prompt to create environment if setting is off' , async ( ) => {
9087 shouldPromptToCreateEnvStub . returns ( false ) ;
91- inExperimentStub . returns ( true ) ;
9288
9389 const disposables : Disposable [ ] = [ ] ;
9490 registerTriggerForPipInTerminal ( disposables ) ;
@@ -97,35 +93,20 @@ suite('Global Pip in Terminal Trigger', () => {
9793 sinon . assert . calledOnce ( shouldPromptToCreateEnvStub ) ;
9894 } ) ;
9995
100- test ( 'Should not prompt to create environment if experiment is off' , async ( ) => {
101- shouldPromptToCreateEnvStub . returns ( true ) ;
102- inExperimentStub . returns ( false ) ;
103-
104- const disposables : Disposable [ ] = [ ] ;
105- registerTriggerForPipInTerminal ( disposables ) ;
106-
107- assert . strictEqual ( disposables . length , 0 ) ;
108- sinon . assert . calledOnce ( shouldPromptToCreateEnvStub ) ;
109- sinon . assert . calledOnce ( inExperimentStub ) ;
110- } ) ;
111-
11296 test ( 'Should not prompt to create environment if no workspace folders' , async ( ) => {
11397 shouldPromptToCreateEnvStub . returns ( true ) ;
114- inExperimentStub . returns ( true ) ;
11598 getWorkspaceFoldersStub . returns ( [ ] ) ;
11699
117100 const disposables : Disposable [ ] = [ ] ;
118101 registerTriggerForPipInTerminal ( disposables ) ;
119102
120103 assert . strictEqual ( disposables . length , 0 ) ;
121104 sinon . assert . calledOnce ( shouldPromptToCreateEnvStub ) ;
122- sinon . assert . calledOnce ( inExperimentStub ) ;
123105 sinon . assert . calledOnce ( getWorkspaceFoldersStub ) ;
124106 } ) ;
125107
126108 test ( 'Should not prompt to create environment if workspace folder is not found' , async ( ) => {
127109 shouldPromptToCreateEnvStub . returns ( true ) ;
128- inExperimentStub . returns ( true ) ;
129110 getWorkspaceFolderStub . returns ( undefined ) ;
130111
131112 const disposables : Disposable [ ] = [ ] ;
@@ -136,16 +117,13 @@ suite('Global Pip in Terminal Trigger', () => {
136117
137118 assert . strictEqual ( disposables . length , 1 ) ;
138119 sinon . assert . calledOnce ( shouldPromptToCreateEnvStub ) ;
139- sinon . assert . calledOnce ( inExperimentStub ) ;
140120 sinon . assert . calledOnce ( getWorkspaceFolderStub ) ;
141-
142121 sinon . assert . notCalled ( isGlobalPythonSelectedStub ) ;
143122 sinon . assert . notCalled ( showWarningMessageStub ) ;
144123 } ) ;
145124
146125 test ( 'Should not prompt to create environment if global python is not selected' , async ( ) => {
147126 shouldPromptToCreateEnvStub . returns ( true ) ;
148- inExperimentStub . returns ( true ) ;
149127 isGlobalPythonSelectedStub . returns ( false ) ;
150128
151129 const disposables : Disposable [ ] = [ ] ;
@@ -155,7 +133,6 @@ suite('Global Pip in Terminal Trigger', () => {
155133
156134 assert . strictEqual ( disposables . length , 1 ) ;
157135 sinon . assert . calledOnce ( shouldPromptToCreateEnvStub ) ;
158- sinon . assert . calledOnce ( inExperimentStub ) ;
159136 sinon . assert . calledOnce ( getWorkspaceFolderStub ) ;
160137 sinon . assert . calledOnce ( isGlobalPythonSelectedStub ) ;
161138
@@ -164,7 +141,6 @@ suite('Global Pip in Terminal Trigger', () => {
164141
165142 test ( 'Should not prompt to create environment if command is not trusted' , async ( ) => {
166143 shouldPromptToCreateEnvStub . returns ( true ) ;
167- inExperimentStub . returns ( true ) ;
168144 isGlobalPythonSelectedStub . returns ( true ) ;
169145
170146 const disposables : Disposable [ ] = [ ] ;
@@ -189,7 +165,6 @@ suite('Global Pip in Terminal Trigger', () => {
189165
190166 assert . strictEqual ( disposables . length , 1 ) ;
191167 sinon . assert . calledOnce ( shouldPromptToCreateEnvStub ) ;
192- sinon . assert . calledOnce ( inExperimentStub ) ;
193168 sinon . assert . calledOnce ( getWorkspaceFolderStub ) ;
194169 sinon . assert . calledOnce ( isGlobalPythonSelectedStub ) ;
195170
@@ -198,7 +173,6 @@ suite('Global Pip in Terminal Trigger', () => {
198173
199174 test ( 'Should not prompt to create environment if command does not start with pip install' , async ( ) => {
200175 shouldPromptToCreateEnvStub . returns ( true ) ;
201- inExperimentStub . returns ( true ) ;
202176 isGlobalPythonSelectedStub . returns ( true ) ;
203177
204178 const disposables : Disposable [ ] = [ ] ;
@@ -223,7 +197,6 @@ suite('Global Pip in Terminal Trigger', () => {
223197
224198 assert . strictEqual ( disposables . length , 1 ) ;
225199 sinon . assert . calledOnce ( shouldPromptToCreateEnvStub ) ;
226- sinon . assert . calledOnce ( inExperimentStub ) ;
227200 sinon . assert . calledOnce ( getWorkspaceFolderStub ) ;
228201 sinon . assert . calledOnce ( isGlobalPythonSelectedStub ) ;
229202
@@ -233,7 +206,6 @@ suite('Global Pip in Terminal Trigger', () => {
233206 [ 'pip install' , 'pip3 install' , 'python -m pip install' , 'python3 -m pip install' ] . forEach ( ( command ) => {
234207 test ( `Should prompt to create environment if all conditions are met: ${ command } ` , async ( ) => {
235208 shouldPromptToCreateEnvStub . returns ( true ) ;
236- inExperimentStub . returns ( true ) ;
237209 isGlobalPythonSelectedStub . returns ( true ) ;
238210 showWarningMessageStub . resolves ( CreateEnv . Trigger . createEnvironment ) ;
239211
@@ -259,11 +231,9 @@ suite('Global Pip in Terminal Trigger', () => {
259231
260232 assert . strictEqual ( disposables . length , 1 ) ;
261233 sinon . assert . calledOnce ( shouldPromptToCreateEnvStub ) ;
262- sinon . assert . calledOnce ( inExperimentStub ) ;
263234 sinon . assert . calledOnce ( getWorkspaceFolderStub ) ;
264235 sinon . assert . calledOnce ( isGlobalPythonSelectedStub ) ;
265236 sinon . assert . calledOnce ( showWarningMessageStub ) ;
266-
267237 sinon . assert . calledOnce ( executeCommandStub ) ;
268238 sinon . assert . notCalled ( disableCreateEnvironmentTriggerStub ) ;
269239
@@ -273,7 +243,7 @@ suite('Global Pip in Terminal Trigger', () => {
273243
274244 test ( "Should disable create environment trigger if user selects don't show again" , async ( ) => {
275245 shouldPromptToCreateEnvStub . returns ( true ) ;
276- inExperimentStub . returns ( true ) ;
246+
277247 isGlobalPythonSelectedStub . returns ( true ) ;
278248 showWarningMessageStub . resolves ( Common . doNotShowAgain ) ;
279249
@@ -299,11 +269,9 @@ suite('Global Pip in Terminal Trigger', () => {
299269
300270 assert . strictEqual ( disposables . length , 1 ) ;
301271 sinon . assert . calledOnce ( shouldPromptToCreateEnvStub ) ;
302- sinon . assert . calledOnce ( inExperimentStub ) ;
303272 sinon . assert . calledOnce ( getWorkspaceFolderStub ) ;
304273 sinon . assert . calledOnce ( isGlobalPythonSelectedStub ) ;
305274 sinon . assert . calledOnce ( showWarningMessageStub ) ;
306-
307275 sinon . assert . notCalled ( executeCommandStub ) ;
308276 sinon . assert . calledOnce ( disableCreateEnvironmentTriggerStub ) ;
309277 } ) ;
0 commit comments