Explorar o código

Create test client session with kernel preferences

Jeremy Tuloup %!s(int64=5) %!d(string=hai) anos
pai
achega
c7a91f7ff3
Modificáronse 2 ficheiros con 19 adicións e 1 borrados
  1. 4 0
      src/session.ts
  2. 15 1
      tests/src/session.spec.ts

+ 4 - 0
src/session.ts

@@ -41,6 +41,10 @@ export class DebugSession implements IDebugger.ISession {
     return this._isDisposed;
   }
 
+  async start(): Promise<void> {
+    return void 0;
+  }
+
   client: IClientSession;
   editors: CodeEditor.IEditor[];
 

+ 15 - 1
tests/src/session.spec.ts

@@ -10,7 +10,14 @@ describe('DebugSession', () => {
   let client: IClientSession;
 
   beforeEach(async () => {
-    client = await createClientSession();
+    client = await createClientSession({
+      kernelPreference: {
+        name: 'python3', // TODO: replace by xpython
+        language: 'python',
+        shouldStart: true,
+        canStart: true
+      }
+    });
     await (client as ClientSession).initialize();
     await client.kernel.ready;
   });
@@ -27,4 +34,11 @@ describe('DebugSession', () => {
       expect(debugSession.isDisposed).to.equal(true);
     });
   });
+
+  describe('#start()', () => {
+    it('should start a new debug session', async () => {
+      const debugSession = new DebugSession({ client });
+      await debugSession.start();
+    });
+  });
 });