@@ -92,7 +92,7 @@ import { PersistentStateFactory } from '../../client/common/persistentState';
92
92
import { IS_WINDOWS } from '../../client/common/platform/constants' ;
93
93
import { PathUtils } from '../../client/common/platform/pathUtils' ;
94
94
import { RegistryImplementation } from '../../client/common/platform/registry' ;
95
- import { IRegistry } from '../../client/common/platform/types' ;
95
+ import { IFileSystem , IRegistry } from '../../client/common/platform/types' ;
96
96
import { CurrentProcess } from '../../client/common/process/currentProcess' ;
97
97
import { BufferDecoder } from '../../client/common/process/decoder' ;
98
98
import { ProcessLogger } from '../../client/common/process/logger' ;
@@ -289,6 +289,7 @@ import { MockCustomEditorService } from './mockCustomEditorService';
289
289
import { MockDebuggerService } from './mockDebugService' ;
290
290
import { MockDocumentManager } from './mockDocumentManager' ;
291
291
import { MockExtensions } from './mockExtensions' ;
292
+ import { MockFileSystem } from './mockFileSystem' ;
292
293
import { MockJupyterManager , SupportedCommands } from './mockJupyterManager' ;
293
294
import { MockJupyterManagerFactory } from './mockJupyterManagerFactory' ;
294
295
import { MockLanguageServerAnalysisOptions } from './mockLanguageServerAnalysisOptions' ;
@@ -408,6 +409,7 @@ export class DataScienceIocContainer extends UnitTestIocContainer {
408
409
const testWorkspaceFolder = path . join ( EXTENSION_ROOT_DIR , 'src' , 'test' , 'datascience' ) ;
409
410
410
411
this . registerFileSystemTypes ( ) ;
412
+ this . serviceManager . rebindInstance < IFileSystem > ( IFileSystem , new MockFileSystem ( ) ) ;
411
413
this . serviceManager . addSingleton < IJupyterExecution > ( IJupyterExecution , JupyterExecutionFactory ) ;
412
414
this . serviceManager . addSingleton < IInteractiveWindowProvider > ( IInteractiveWindowProvider , TestInteractiveWindowProvider ) ;
413
415
this . serviceManager . addSingleton < IDataViewerProvider > ( IDataViewerProvider , DataViewerProvider ) ;
@@ -763,6 +765,10 @@ export class DataScienceIocContainer extends UnitTestIocContainer {
763
765
this . addInterpreter ( this . workingPython2 , SupportedCommands . all ) ;
764
766
this . addInterpreter ( this . workingPython , SupportedCommands . all ) ;
765
767
}
768
+ public setFileContents ( uri : Uri , contents : string ) {
769
+ const fileSystem = this . serviceManager . get < IFileSystem > ( IFileSystem ) as MockFileSystem ;
770
+ fileSystem . addFileContents ( uri . fsPath , contents ) ;
771
+ }
766
772
767
773
public async activate ( ) : Promise < void > {
768
774
// Activate all of the extension activation services
0 commit comments