@@ -181,6 +181,32 @@ getInfoPerOS().forEach(([osName, osType, path]) => {
181181 . deep . equal ( debugOptionsAvailable ) ;
182182 expect ( debugConfig ) . to . have . property ( 'host' , 'localhost' ) ;
183183 } ) ;
184+ test ( 'Default host should not be added if connect is available.' , async ( ) => {
185+ const pythonFile = 'xyz.py' ;
186+
187+ setupActiveEditor ( pythonFile , PYTHON_LANGUAGE ) ;
188+ setupWorkspaces ( [ ] ) ;
189+
190+ const debugConfig = await debugProvider . resolveDebugConfiguration ! ( undefined , {
191+ request : 'attach' ,
192+ connect : { host : 'localhost' , port : 5678 }
193+ } as AttachRequestArguments ) ;
194+
195+ expect ( debugConfig ) . to . not . have . property ( 'host' , 'localhost' ) ;
196+ } ) ;
197+ test ( 'Default host should not be added if listen is available.' , async ( ) => {
198+ const pythonFile = 'xyz.py' ;
199+
200+ setupActiveEditor ( pythonFile , PYTHON_LANGUAGE ) ;
201+ setupWorkspaces ( [ ] ) ;
202+
203+ const debugConfig = await debugProvider . resolveDebugConfiguration ! ( undefined , {
204+ request : 'attach' ,
205+ listen : { host : 'localhost' , port : 5678 }
206+ } as AttachRequestArguments ) ;
207+
208+ expect ( debugConfig ) . to . not . have . property ( 'host' , 'localhost' ) ;
209+ } ) ;
184210 test ( "Ensure 'localRoot' is left unaltered" , async ( ) => {
185211 const activeFile = 'xyz.py' ;
186212 const workspaceFolder = createMoqWorkspaceFolder ( __dirname ) ;
0 commit comments