Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@
"debug.attachRemoteHostTitle": "Remote Debugging",
"debug.attachRemoteHostPrompt": "Enter a host name or IP address",
"debug.attachRemoteHostValidationError": "Enter a valid host name or IP address",
"UnitTests.testErrorDiagnosticMessage": "Error",
"UnitTests.testFailDiagnosticMessage": "Fail",
"UnitTests.testSkippedDiagnosticMessage": "Skipped",
"UnitTests.configureTests": "Configure Test Framework",
"UnitTests.disableTests": "Disable Tests",
"Testing.testErrorDiagnosticMessage": "Error",
"Testing.testFailDiagnosticMessage": "Fail",
"Testing.testSkippedDiagnosticMessage": "Skipped",
"Testing.configureTests": "Configure Test Framework",
"Testing.disableTests": "Disable Tests",
"Common.openOutputPanel": "Show output",
"LanguageService.downloadFailedOutputMessage": "download failed",
"LanguageService.extractionFailedOutputMessage": "extraction failed",
Expand Down
12 changes: 6 additions & 6 deletions src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ export namespace DebugConfigurationPrompts {
export const attachRemoteHostValidationError = localize('debug.attachRemoteHostValidationError', 'Enter a host name or IP address');
}

export namespace UnitTests {
export const testErrorDiagnosticMessage = localize('UnitTests.testErrorDiagnosticMessage', 'Error');
export const testFailDiagnosticMessage = localize('UnitTests.testFailDiagnosticMessage', 'Fail');
export const testSkippedDiagnosticMessage = localize('UnitTests.testSkippedDiagnosticMessage', 'Skipped');
export const configureTests = localize('UnitTests.configureTests', 'Configure Test Framework');
export const disableTests = localize('UnitTests.disableTests', 'Disable Tests');
export namespace Testing {
export const testErrorDiagnosticMessage = localize('Testing.testErrorDiagnosticMessage', 'Error');
export const testFailDiagnosticMessage = localize('Testing.testFailDiagnosticMessage', 'Fail');
export const testSkippedDiagnosticMessage = localize('Testing.testSkippedDiagnosticMessage', 'Skipped');
export const configureTests = localize('Testing.configureTests', 'Configure Test Framework');
export const disableTests = localize('Testing.disableTests', 'Disable Tests');
}

// Skip using vscode-nls and instead just compute our strings based on key values. Key values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export class UnitTestDiagnosticService implements IUnitTestDiagnosticService {
this.MessageSeverities.set(PythonUnitTestMessageSeverity.Failure, DiagnosticSeverity.Error);
this.MessageSeverities.set(PythonUnitTestMessageSeverity.Skip, DiagnosticSeverity.Information);
this.MessageSeverities.set(PythonUnitTestMessageSeverity.Pass, undefined);
this.MessagePrefixes.set(DiagnosticMessageType.Error, localize.UnitTests.testErrorDiagnosticMessage());
this.MessagePrefixes.set(DiagnosticMessageType.Fail, localize.UnitTests.testFailDiagnosticMessage());
this.MessagePrefixes.set(DiagnosticMessageType.Skipped, localize.UnitTests.testSkippedDiagnosticMessage());
this.MessagePrefixes.set(DiagnosticMessageType.Error, localize.Testing.testErrorDiagnosticMessage());
this.MessagePrefixes.set(DiagnosticMessageType.Fail, localize.Testing.testFailDiagnosticMessage());
this.MessagePrefixes.set(DiagnosticMessageType.Skipped, localize.Testing.testSkippedDiagnosticMessage());
this.MessagePrefixes.set(DiagnosticMessageType.Pass, '');
}
public getMessagePrefix(status: TestStatus): string | undefined {
Expand Down
8 changes: 4 additions & 4 deletions src/client/unittests/display/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IApplicationShell, ICommandManager } from '../../common/application/typ
import * as constants from '../../common/constants';
import { isNotInstalledError } from '../../common/helpers';
import { IConfigurationService } from '../../common/types';
import { UnitTests } from '../../common/utils/localize';
import { Testing } from '../../common/utils/localize';
import { noop } from '../../common/utils/misc';
import { IServiceContainer } from '../../ioc/types';
import { captureTelemetry } from '../../telemetry';
Expand Down Expand Up @@ -171,11 +171,11 @@ export class TestResultDisplay implements ITestResultDisplay {
}

if (!haveTests && !quietMode) {
this.appShell.showInformationMessage('No tests discovered, please check the configuration settings for the tests.', UnitTests.disableTests(), UnitTests.configureTests()).then(item => {
if (item === UnitTests.disableTests()) {
this.appShell.showInformationMessage('No tests discovered, please check the configuration settings for the tests.', Testing.disableTests(), Testing.configureTests()).then(item => {
if (item === Testing.disableTests()) {
this.disableTests()
.catch(ex => console.error('Python Extension: disableTests', ex));
} else if (item === UnitTests.configureTests()) {
} else if (item === Testing.configureTests()) {
this.cmdManager.executeCommand(constants.Commands.Tests_Configure, undefined, undefined, undefined).then(noop);
}
});
Expand Down
6 changes: 3 additions & 3 deletions src/test/unittests/display/main.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Commands } from '../../../client/common/constants';
import '../../../client/common/extensions';
import { IConfigurationService, IPythonSettings, IUnitTestSettings } from '../../../client/common/types';
import { createDeferred } from '../../../client/common/utils/async';
import { UnitTests } from '../../../client/common/utils/localize';
import { Testing } from '../../../client/common/utils/localize';
import { noop } from '../../../client/common/utils/misc';
import { IServiceContainer } from '../../../client/ioc/types';
import { CANCELLATION_REASON } from '../../../client/unittests/common/constants';
Expand Down Expand Up @@ -298,7 +298,7 @@ suite('Unit Tests - TestResultDisplay', () => {

const tests = typeMoq.Mock.ofType<Tests>();
appShell.setup(a => a.showInformationMessage(typeMoq.It.isAny(), typeMoq.It.isAny(), typeMoq.It.isAny(), typeMoq.It.isAny()))
.returns(() => Promise.resolve(UnitTests.disableTests()))
.returns(() => Promise.resolve(Testing.disableTests()))
.verifiable(typeMoq.Times.once());

for (const setting of ['unitTest.promptToConfigure', 'unitTest.pyTestEnabled',
Expand Down Expand Up @@ -335,7 +335,7 @@ suite('Unit Tests - TestResultDisplay', () => {

const tests = typeMoq.Mock.ofType<Tests>();
appShell.setup(a => a.showInformationMessage(typeMoq.It.isAny(), typeMoq.It.isAny(), typeMoq.It.isAny(), typeMoq.It.isAny()))
.returns(() => Promise.resolve(UnitTests.configureTests()))
.returns(() => Promise.resolve(Testing.configureTests()))
.verifiable(typeMoq.Times.once());

const undefinedArg = typeMoq.It.isValue(undefined);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ suite('UnitTestDiagnosticService: unittest', () => {
suiteSetup(() => {
actualPrefix = diagnosticService.getMessagePrefix(TestStatus.Error)!;
actualSeverity = diagnosticService.getSeverity(PythonUnitTestMessageSeverity.Error)!;
expectedPrefix = localize.UnitTests.testErrorDiagnosticMessage();
expectedPrefix = localize.Testing.testErrorDiagnosticMessage();
expectedSeverity = DiagnosticSeverity.Error;
});
test('Message Prefix', () => {
Expand All @@ -42,7 +42,7 @@ suite('UnitTestDiagnosticService: unittest', () => {
suiteSetup(() => {
actualPrefix = diagnosticService.getMessagePrefix(TestStatus.Fail)!;
actualSeverity = diagnosticService.getSeverity(PythonUnitTestMessageSeverity.Failure)!;
expectedPrefix = localize.UnitTests.testFailDiagnosticMessage();
expectedPrefix = localize.Testing.testFailDiagnosticMessage();
expectedSeverity = DiagnosticSeverity.Error;
});
test('Message Prefix', () => {
Expand All @@ -60,7 +60,7 @@ suite('UnitTestDiagnosticService: unittest', () => {
suiteSetup(() => {
actualPrefix = diagnosticService.getMessagePrefix(TestStatus.Skipped)!;
actualSeverity = diagnosticService.getSeverity(PythonUnitTestMessageSeverity.Skip)!;
expectedPrefix = localize.UnitTests.testSkippedDiagnosticMessage();
expectedPrefix = localize.Testing.testSkippedDiagnosticMessage();
expectedSeverity = DiagnosticSeverity.Information;
});
test('Message Prefix', () => {
Expand Down