@@ -36,7 +36,7 @@ import { ICodeExecutionHelper } from '../../../client/terminals/types';
3636import { PYTHON_PATH } from '../../common' ;
3737
3838const TEST_FILES_PATH = path . join ( EXTENSION_ROOT_DIR , 'src' , 'test' , 'python_files' , 'terminalExec' ) ;
39- // TODO: tests for 3.13 relevant sequences
39+
4040suite ( 'Terminal - Code Execution Helper' , ( ) => {
4141 let activeResourceService : TypeMoq . IMock < IActiveResourceService > ;
4242 let documentManager : TypeMoq . IMock < IDocumentManager > ;
@@ -53,8 +53,8 @@ suite('Terminal - Code Execution Helper', () => {
5353 let jsonParseStub : sinon . SinonStub ;
5454 const workingPython : PythonEnvironment = {
5555 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' ,
5858 sysPrefix : 'Python' ,
5959 displayName : 'Python' ,
6060 envType : EnvironmentType . Unknown ,
@@ -166,6 +166,36 @@ suite('Terminal - Code Execution Helper', () => {
166166 jsonParseStub . restore ( ) ;
167167 } ) ;
168168
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+
169199 test ( 'normalizeLines should call normalizeSelection.py' , async ( ) => {
170200 jsonParseStub . restore ( ) ;
171201 let execArgs = '' ;
@@ -219,7 +249,6 @@ suite('Terminal - Code Execution Helper', () => {
219249 path . join ( TEST_FILES_PATH , `sample${ fileNameSuffix } _normalized_selection.py` ) ,
220250 'utf8' ,
221251 ) ;
222- // python3 -m pythonFiles.tests
223252 await ensureCodeIsNormalized ( code , expectedCode ) ;
224253 } ) ;
225254 } ) ;
0 commit comments