Skip to content

Commit dbcddad

Browse files
Drop the fixPath() testing helper.
1 parent c3e17e9 commit dbcddad

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/test/pythonEnvironments/base/common.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@ import { parseVersion } from '../../../client/pythonEnvironments/base/info/pytho
1313
import { IPythonEnvsIterator, Locator, PythonLocatorQuery } from '../../../client/pythonEnvironments/base/locator';
1414
import { PythonEnvsChangedEvent } from '../../../client/pythonEnvironments/base/watcher';
1515

16-
export function fixPath(filename: string): string {
17-
return path.normalize(filename);
18-
}
19-
2016
export function createLocatedEnv(
2117
locationStr: string,
2218
versionStr: string,
2319
kind = PythonEnvKind.Unknown,
2420
execStr = 'python',
2521
): PythonEnvInfo {
26-
const location = fixPath(locationStr);
27-
const normalizedExecutable = fixPath(execStr);
22+
const location = path.normalize(locationStr);
23+
const normalizedExecutable = path.normalize(execStr);
2824
const executable = location === '' || path.isAbsolute(normalizedExecutable)
2925
? normalizedExecutable
3026
: path.join(location, 'bin', normalizedExecutable);

src/test/pythonEnvironments/base/locatorUtils.unit.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@ import { getEnvs, getQueryFilter } from '../../../client/pythonEnvironments/base
1616
import {
1717
createLocatedEnv,
1818
createNamedEnv,
19-
fixPath,
2019
} from './common';
2120

22-
const homeDir = fixPath('/home/me');
21+
const homeDir = path.normalize('/home/me');
2322
const workspaceRoot = Uri.file('workspace-root');
24-
const doesNotExist = Uri.file(fixPath('does-not-exist'));
23+
const doesNotExist = Uri.file(path.normalize('does-not-exist'));
2524

2625
function setSearchLocation(env: PythonEnvInfo, location?: string): void {
2726
const locationStr = location === undefined
2827
? path.dirname(env.location)
29-
: fixPath(location);
28+
: path.normalize(location);
3029
env.searchLocation = Uri.file(locationStr);
3130
}
3231

0 commit comments

Comments
 (0)