Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulacamargo25 committed Mar 12, 2024
1 parent f716404 commit 8a21673
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/test/common/application/commands/issueTemplate.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!-- Please fill in all XXX markers -->
# Behaviour
## Expected vs. Actual

XXX

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
- Value of the `python.languageServer` setting: Pylance

<details>

<summary>User Settings</summary>

<p>

```
Expand All @@ -20,6 +18,13 @@ venvPath: "<placeholder>"
pipenvPath: "<placeholder>"
```

</p>
</details>
</details>

<details>
<summary>Installed Extensions</summary>

|Extension Name |Extension Id| Version|
|---|---|---|
|Python|ms-python.python|2020.2|
</details>
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
- Value of the `python.languageServer` setting: Pylance

<details>

<summary>User Settings</summary>

<p>

```
Expand All @@ -17,6 +15,13 @@ experiments
venvPath: "<placeholder>"
```

</p>
</details>
</details>

<details>
<summary>Installed Extensions</summary>

|Extension Name |Extension Id| Version|
|---|---|---|
|Python|ms-python.python|2020.2|
</details>
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { IConfigurationService } from '../../../../client/common/types';
import { EventName } from '../../../../client/telemetry/constants';
import { EnvironmentType, PythonEnvironment } from '../../../../client/pythonEnvironments/info';
import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../../constants';
import * as extensionsApi from '../../../../client/common/vscodeApis/extensionsApi';

suite('Report Issue Command', () => {
let reportIssueCommandHandler: ReportIssueCommandHandler;
Expand All @@ -39,13 +40,15 @@ suite('Report Issue Command', () => {
let configurationService: IConfigurationService;
let appEnvironment: IApplicationEnvironment;
let expectedIssueBody: string;
let getExtensionsStub: sinon.SinonStub;

setup(async () => {
workspaceService = mock(WorkspaceService);
cmdManager = mock(CommandManager);
interpreterService = mock(InterpreterService);
configurationService = mock(ConfigurationService);
appEnvironment = mock<IApplicationEnvironment>();
getExtensionsStub = sinon.stub(extensionsApi, 'getExtensions');

when(cmdManager.executeCommand('workbench.action.openIssueReporter', anything())).thenResolve();
when(workspaceService.getConfiguration('python')).thenReturn(
Expand Down Expand Up @@ -91,6 +94,16 @@ suite('Report Issue Command', () => {
'issueTemplate.md',
);
expectedIssueBody = fs.readFileSync(issueTemplatePath, 'utf8');

getExtensionsStub.returns([
{
id: 'ms-python.python',
packageJSON: {
displayName: 'Python',
version: '2020.2',
},
},
]);
});

teardown(() => {
Expand Down

0 comments on commit 8a21673

Please sign in to comment.