@@ -68,38 +68,67 @@ suite('Interpreters - Service Registry', () => {
6868 const serviceManager = mock ( ServiceManager ) ;
6969 const serviceContainer = mock ( ServiceContainer ) ;
7070 registerForIOC ( instance ( serviceManager ) , instance ( serviceContainer ) ) ;
71+ verify ( serviceManager . addSingleton ( IKnownSearchPathsForInterpreters , KnownSearchPathsForInterpreters ) ) . once ( ) ;
72+ verify ( serviceManager . addSingleton ( IVirtualEnvironmentsSearchPathProvider , GlobalVirtualEnvironmentsSearchPathProvider , 'global' ) ) . once ( ) ;
73+ verify ( serviceManager . addSingleton ( IVirtualEnvironmentsSearchPathProvider , WorkspaceVirtualEnvironmentsSearchPathProvider , 'workspace' ) ) . once ( ) ;
7174
72- [
73- [ IKnownSearchPathsForInterpreters , KnownSearchPathsForInterpreters ] ,
74- [ IVirtualEnvironmentsSearchPathProvider , GlobalVirtualEnvironmentsSearchPathProvider , 'global' ] ,
75- [ IVirtualEnvironmentsSearchPathProvider , WorkspaceVirtualEnvironmentsSearchPathProvider , 'workspace' ] ,
75+ verify ( serviceManager . addSingleton ( ICondaService , CondaService ) ) . once ( ) ;
76+ verify ( serviceManager . addSingleton ( IPipEnvServiceHelper , PipEnvServiceHelper ) ) . once ( ) ;
77+ verify ( serviceManager . addSingleton ( IPythonInPathCommandProvider , PythonInPathCommandProvider ) ) . once ( ) ;
7678
77- [ ICondaService , CondaService ] ,
78- [ IPipEnvServiceHelper , PipEnvServiceHelper ] ,
79- [ IPythonInPathCommandProvider , PythonInPathCommandProvider ] ,
79+ verify ( serviceManager . addSingleton ( IInterpreterWatcherBuilder , InterpreterWatcherBuilder ) ) . once ( ) ;
8080
81- [ IInterpreterWatcherBuilder , InterpreterWatcherBuilder ] ,
81+ verify (
82+ serviceManager . addSingleton (
83+ IInterpreterLocatorService ,
84+ PythonInterpreterLocatorService ,
85+ INTERPRETER_LOCATOR_SERVICE ,
86+ ) ,
87+ ) . once ( ) ;
88+ verify (
89+ serviceManager . addSingleton ( IInterpreterLocatorService , CondaEnvFileService , CONDA_ENV_FILE_SERVICE ) ,
90+ ) . once ( ) ;
91+ verify ( serviceManager . addSingleton ( IInterpreterLocatorService , CondaEnvService , CONDA_ENV_SERVICE ) ) . once ( ) ;
92+ verify (
93+ serviceManager . addSingleton ( IInterpreterLocatorService , CurrentPathService , CURRENT_PATH_SERVICE ) ,
94+ ) . once ( ) ;
95+ verify (
96+ serviceManager . addSingleton (
97+ IInterpreterLocatorService ,
98+ GlobalVirtualEnvService ,
99+ GLOBAL_VIRTUAL_ENV_SERVICE ,
100+ ) ,
101+ ) . once ( ) ;
102+ verify (
103+ serviceManager . addSingleton (
104+ IInterpreterLocatorService ,
105+ WorkspaceVirtualEnvService ,
106+ WORKSPACE_VIRTUAL_ENV_SERVICE ,
107+ ) ,
108+ ) . once ( ) ;
109+ verify ( serviceManager . addSingleton ( IInterpreterLocatorService , PipEnvService , PIPENV_SERVICE ) ) . once ( ) ;
82110
83- [ IInterpreterLocatorService , PythonInterpreterLocatorService , INTERPRETER_LOCATOR_SERVICE ] ,
84- [ IInterpreterLocatorService , CondaEnvFileService , CONDA_ENV_FILE_SERVICE ] ,
85- [ IInterpreterLocatorService , CondaEnvService , CONDA_ENV_SERVICE ] ,
86- [ IInterpreterLocatorService , CurrentPathService , CURRENT_PATH_SERVICE ] ,
87- [ IInterpreterLocatorService , GlobalVirtualEnvService , GLOBAL_VIRTUAL_ENV_SERVICE ] ,
88- [ IInterpreterLocatorService , WorkspaceVirtualEnvService , WORKSPACE_VIRTUAL_ENV_SERVICE ] ,
89- [ IInterpreterLocatorService , PipEnvService , PIPENV_SERVICE ] ,
111+ verify (
112+ serviceManager . addSingleton (
113+ IInterpreterLocatorService ,
114+ WindowsRegistryService ,
115+ WINDOWS_REGISTRY_SERVICE ,
116+ ) ,
117+ ) . once ( ) ;
118+ verify ( serviceManager . addSingleton ( IInterpreterLocatorService , KnownPathsService , KNOWN_PATH_SERVICE ) ) . once ( ) ;
90119
91- [ IInterpreterLocatorService , WindowsRegistryService , WINDOWS_REGISTRY_SERVICE ] ,
92- [ IInterpreterLocatorService , KnownPathsService , KNOWN_PATH_SERVICE ] ,
120+ verify ( serviceManager . addSingleton ( IInterpreterLocatorHelper , InterpreterLocatorHelper ) ) . once ( ) ;
121+ verify (
122+ serviceManager . addSingleton (
123+ IInterpreterLocatorProgressService ,
124+ InterpreterLocatorProgressService ,
125+ ) ,
126+ ) . once ( ) ;
93127
94- [ IInterpreterLocatorHelper , InterpreterLocatorHelper ] ,
95- [ IInterpreterLocatorProgressService , InterpreterLocatorProgressService ] ,
128+ verify ( serviceManager . addSingleton ( WindowsStoreInterpreter , WindowsStoreInterpreter ) ) . once ( ) ;
129+ verify ( serviceManager . addSingleton ( InterpreterHashProvider , InterpreterHashProvider ) ) . once ( ) ;
130+ verify ( serviceManager . addSingleton ( InterpeterHashProviderFactory , InterpeterHashProviderFactory ) ) . once ( ) ;
96131
97- [ WindowsStoreInterpreter , WindowsStoreInterpreter ] ,
98- [ InterpreterHashProvider , InterpreterHashProvider ] ,
99- [ InterpeterHashProviderFactory , InterpeterHashProviderFactory ] ,
100- ] . forEach ( ( mapping ) => {
101- verify ( serviceManager . addSingleton . apply ( serviceManager , mapping as any ) ) . once ( ) ;
102- } ) ;
103132 verify (
104133 serviceManager . add < IInterpreterWatcher > (
105134 IInterpreterWatcher ,
0 commit comments