@@ -36,7 +36,7 @@ import { ICodeExecutionHelper } from '../../../client/terminals/types';
36
36
import { PYTHON_PATH } from '../../common' ;
37
37
38
38
const TEST_FILES_PATH = path . join ( EXTENSION_ROOT_DIR , 'src' , 'test' , 'python_files' , 'terminalExec' ) ;
39
- // TODO: tests for 3.13 relevant sequences
39
+
40
40
suite ( 'Terminal - Code Execution Helper' , ( ) => {
41
41
let activeResourceService : TypeMoq . IMock < IActiveResourceService > ;
42
42
let documentManager : TypeMoq . IMock < IDocumentManager > ;
@@ -53,8 +53,8 @@ suite('Terminal - Code Execution Helper', () => {
53
53
let jsonParseStub : sinon . SinonStub ;
54
54
const workingPython : PythonEnvironment = {
55
55
path : PYTHON_PATH ,
56
- version : new SemVer ( '3.13.0 ' ) ,
57
- sysVersion : '3.13 .0' ,
56
+ version : new SemVer ( '3.6.6-final ' ) ,
57
+ sysVersion : '1.0.0 .0' ,
58
58
sysPrefix : 'Python' ,
59
59
displayName : 'Python' ,
60
60
envType : EnvironmentType . Unknown ,
@@ -166,6 +166,36 @@ suite('Terminal - Code Execution Helper', () => {
166
166
jsonParseStub . restore ( ) ;
167
167
} ) ;
168
168
169
+ test ( 'normalizeLines should not attach bracketed paste for < 3.13' , async ( ) => {
170
+ jsonParseStub = sinon . stub ( JSON , 'parse' ) ;
171
+ const mockResult = {
172
+ normalized : 'print("Looks like you are not on 3.13")' ,
173
+ attach_bracket_paste : false ,
174
+ } ;
175
+ jsonParseStub . returns ( mockResult ) ;
176
+
177
+ configurationService
178
+ . setup ( ( c ) => c . getSettings ( TypeMoq . It . isAny ( ) ) )
179
+ . returns ( {
180
+ REPL : {
181
+ EnableREPLSmartSend : false ,
182
+ REPLSmartSend : false ,
183
+ } ,
184
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
185
+ } as any ) ;
186
+ const actualProcessService = new ProcessService ( ) ;
187
+ processService
188
+ . setup ( ( p ) => p . execObservable ( TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) , TypeMoq . It . isAny ( ) ) )
189
+ . returns ( ( file , args , options ) =>
190
+ actualProcessService . execObservable . apply ( actualProcessService , [ file , args , options ] ) ,
191
+ ) ;
192
+
193
+ const result = await helper . normalizeLines ( 'print("Looks like you are not on 3.13")' ) ;
194
+
195
+ expect ( result ) . to . equal ( 'print("Looks like you are not on 3.13")' ) ;
196
+ jsonParseStub . restore ( ) ;
197
+ } ) ;
198
+
169
199
test ( 'normalizeLines should call normalizeSelection.py' , async ( ) => {
170
200
jsonParseStub . restore ( ) ;
171
201
let execArgs = '' ;
@@ -219,7 +249,6 @@ suite('Terminal - Code Execution Helper', () => {
219
249
path . join ( TEST_FILES_PATH , `sample${ fileNameSuffix } _normalized_selection.py` ) ,
220
250
'utf8' ,
221
251
) ;
222
- // python3 -m pythonFiles.tests
223
252
await ensureCodeIsNormalized ( code , expectedCode ) ;
224
253
} ) ;
225
254
} ) ;
0 commit comments