Skip to content

Commit

Permalink
fix uri in test
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd committed Oct 31, 2023
1 parent 90783f8 commit 79de1b2
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ITestResultResolver, ITestServer } from '../../../client/testing/testCo
import * as testItemUtilities from '../../../client/testing/testController/common/testItemUtilities';
import * as util from '../../../client/testing/testController/common/utils';
import * as ResultResolver from '../../../client/testing/testController/common/resultResolver';
import { IPythonExecutionFactory } from '../../../client/common/process/types';

suite('Workspace test adapter', () => {
suite('Test discovery', () => {
Expand Down Expand Up @@ -137,12 +138,12 @@ suite('Workspace test adapter', () => {
stubConfigSettings,
outputChannel.object,
);

const uriFoo = Uri.parse('foo');
const workspaceTestAdapter = new WorkspaceTestAdapter(
'unittest',
testDiscoveryAdapter,
testExecutionAdapter,
Uri.parse('foo'),
uriFoo,
stubResultResolver,
);

Expand All @@ -164,10 +165,11 @@ suite('Workspace test adapter', () => {
const buildErrorNodeOptionsStub = sinon.stub(util, 'buildErrorNodeOptions').returns(errorTestItemOptions);
const testProvider = 'unittest';

await workspaceTestAdapter.discoverTests(testController);
const execFactory = typemoq.Mock.ofType<IPythonExecutionFactory>();
await workspaceTestAdapter.discoverTests(testController, undefined, execFactory.object);

sinon.assert.calledWithMatch(createErrorTestItemStub, sinon.match.any, sinon.match.any);
sinon.assert.calledWithMatch(buildErrorNodeOptionsStub, Uri.parse('foo'), sinon.match.any, testProvider);
sinon.assert.calledWithMatch(buildErrorNodeOptionsStub, uriFoo, sinon.match.any, testProvider);
});

test("When discovering tests, the workspace test adapter should call the test discovery adapter's discoverTest method", async () => {
Expand Down

0 comments on commit 79de1b2

Please sign in to comment.