forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterpreters.ts
More file actions
28 lines (25 loc) · 956 Bytes
/
interpreters.ts
File metadata and controls
28 lines (25 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { Architecture } from '../../client/common/utils/platform';
import { EnvironmentType, PythonEnvironment } from '../../client/pythonEnvironments/info';
/**
* Creates a PythonInterpreter object for testing purposes, with unique name, version and path.
* If required a custom name, version and the like can be provided.
*
* @export
* @param {Partial<PythonEnvironment>} [info]
* @returns {PythonEnvironment}
*/
export function createPythonInterpreter(info?: Partial<PythonEnvironment>): PythonEnvironment {
const rnd = new Date().getTime().toString();
return {
displayName: `Something${rnd}`,
architecture: Architecture.Unknown,
path: `somePath${rnd}`,
sysPrefix: `someSysPrefix${rnd}`,
sysVersion: `1.1.1`,
envType: EnvironmentType.Unknown,
...(info || {}),
};
}