mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-26 06:40:30 -04:00
Fix kernel name check bug, double-event hooking, and other Notebook issues (#4016)
* Fix error where kernel name was compared to itself. This doesn't break anything right now since we happen to have special handling of Python3, and for other kernels they share the same set of supported providers (which is what the check is used for). However it needs fixing for next release. * Fix console error due to queryTextEditor trying to access model before it's ready * Fix issues where notebook model hooked to session events multiple times * Removed calls that weren't needed such as loadActiveContexts (if undefined, does nothing) and passing connection to initialize method
This commit is contained in:
@@ -101,7 +101,7 @@ describe('notebook model', function(): void {
|
||||
capabilitiesService: capabilitiesService.object
|
||||
};
|
||||
mockClientSession = TypeMoq.Mock.ofType(ClientSession, undefined, defaultModelOptions);
|
||||
mockClientSession.setup(c => c.initialize(TypeMoq.It.isAny())).returns(() => {
|
||||
mockClientSession.setup(c => c.initialize()).returns(() => {
|
||||
return Promise.resolve();
|
||||
});
|
||||
mockClientSession.setup(c => c.ready).returns(() => sessionReady.promise);
|
||||
@@ -203,10 +203,12 @@ describe('notebook model', function(): void {
|
||||
mockContentManager.setup(c => c.getNotebookContents(TypeMoq.It.isAny())).returns(() => Promise.resolve(expectedNotebookContentOneCell));
|
||||
notebookManagers[0].contentManager = mockContentManager.object;
|
||||
let kernelChangedEmitter: Emitter<nb.IKernelChangedArgs> = new Emitter<nb.IKernelChangedArgs>();
|
||||
let statusChangedEmitter: Emitter<nb.ISession> = new Emitter<nb.ISession>();
|
||||
|
||||
mockClientSession.setup(c => c.isInErrorState).returns(() => false);
|
||||
mockClientSession.setup(c => c.isReady).returns(() => true);
|
||||
mockClientSession.setup(c => c.kernelChanged).returns(() => kernelChangedEmitter.event);
|
||||
mockClientSession.setup(c => c.statusChanged).returns(() => statusChangedEmitter.event);
|
||||
|
||||
queryConnectionService.setup(c => c.getActiveConnections(TypeMoq.It.isAny())).returns(() => null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user