Skip to content

Commit 8a21673

Browse files
fix tests
1 parent f716404 commit 8a21673

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

src/test/common/application/commands/issueTemplate.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<!-- Please fill in all XXX markers -->
22
# Behaviour
3-
## Expected vs. Actual
43

54
XXX
65

src/test/common/application/commands/issueUserDataTemplateVenv1.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
- Value of the `python.languageServer` setting: Pylance
44

55
<details>
6-
76
<summary>User Settings</summary>
8-
97
<p>
108

119
```
@@ -20,6 +18,13 @@ venvPath: "<placeholder>"
2018
pipenvPath: "<placeholder>"
2119
2220
```
23-
2421
</p>
25-
</details>
22+
</details>
23+
24+
<details>
25+
<summary>Installed Extensions</summary>
26+
27+
|Extension Name |Extension Id| Version|
28+
|---|---|---|
29+
|Python|ms-python.python|2020.2|
30+
</details>

src/test/common/application/commands/issueUserDataTemplateVenv2.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
- Value of the `python.languageServer` setting: Pylance
44

55
<details>
6-
76
<summary>User Settings</summary>
8-
97
<p>
108

119
```
@@ -17,6 +15,13 @@ experiments
1715
venvPath: "<placeholder>"
1816
1917
```
20-
2118
</p>
22-
</details>
19+
</details>
20+
21+
<details>
22+
<summary>Installed Extensions</summary>
23+
24+
|Extension Name |Extension Id| Version|
25+
|---|---|---|
26+
|Python|ms-python.python|2020.2|
27+
</details>

src/test/common/application/commands/reportIssueCommand.unit.test.ts

+13
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { IConfigurationService } from '../../../../client/common/types';
3030
import { EventName } from '../../../../client/telemetry/constants';
3131
import { EnvironmentType, PythonEnvironment } from '../../../../client/pythonEnvironments/info';
3232
import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../../constants';
33+
import * as extensionsApi from '../../../../client/common/vscodeApis/extensionsApi';
3334

3435
suite('Report Issue Command', () => {
3536
let reportIssueCommandHandler: ReportIssueCommandHandler;
@@ -39,13 +40,15 @@ suite('Report Issue Command', () => {
3940
let configurationService: IConfigurationService;
4041
let appEnvironment: IApplicationEnvironment;
4142
let expectedIssueBody: string;
43+
let getExtensionsStub: sinon.SinonStub;
4244

4345
setup(async () => {
4446
workspaceService = mock(WorkspaceService);
4547
cmdManager = mock(CommandManager);
4648
interpreterService = mock(InterpreterService);
4749
configurationService = mock(ConfigurationService);
4850
appEnvironment = mock<IApplicationEnvironment>();
51+
getExtensionsStub = sinon.stub(extensionsApi, 'getExtensions');
4952

5053
when(cmdManager.executeCommand('workbench.action.openIssueReporter', anything())).thenResolve();
5154
when(workspaceService.getConfiguration('python')).thenReturn(
@@ -91,6 +94,16 @@ suite('Report Issue Command', () => {
9194
'issueTemplate.md',
9295
);
9396
expectedIssueBody = fs.readFileSync(issueTemplatePath, 'utf8');
97+
98+
getExtensionsStub.returns([
99+
{
100+
id: 'ms-python.python',
101+
packageJSON: {
102+
displayName: 'Python',
103+
version: '2020.2',
104+
},
105+
},
106+
]);
94107
});
95108

96109
teardown(() => {

0 commit comments

Comments
 (0)